diff --git a/.gitignore b/.gitignore index 98b8d79..f7f9ffa 100755 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,30 @@ -# elm-package generated files -elm-stuff - -# elm-repl generated files -repl-temp-* - -# elm-make generated docs -docs.json - -# VS Code settings -.vscode - -# elm-make generated files -examples/**/main.js - -# experiments -experiments/* -!experiments/README.md -!experiments/Main.elm -!experiments/elm.json - -# node modules -node_modules + +# node modules +node_modules + +# elm-package generated files +elm-stuff + +# elm-repl generated files +repl-temp-* + +# elm-make generated docs +docs.json + +# VS Code settings +.vscode + +# IntelliJ IDEA settings +.idea + +# EditorConfig settings +.editorconfig + +# elm-make generated files +examples/assets/main.js +examples/assets/*.css +examples/assets/*.css.map + +# experiments +experiments/index.html +examples/src/WeakCSS/* diff --git a/.travis.yml b/.travis.yml index 09373e4..13a5dcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: node_js -node_js: "10" +node_js: "12" cache: directories: diff --git a/CHANGELOG.md b/CHANGELOG.md index afed02b..c1e21ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,116 +2,109 @@ All notable changes to this project will be documented in this file. -## [6.0.0] - 2020-03-08 +## [7.0.0] - upcoming -### Added +### Fixes -- Add `startPosition` field to `Info` in the `DnDList` module only. -- Add `currentPosition` field to `Info` in the `DnDList` module only. +- Stop sending messages from commands -### Changed +### Features -- Use fixed `position` instead of absolute in `ghostStyles` in both modules. +### Maintenance -## [5.0.0] - 2019-05-06 +- Update README, documentation, and examples reflecting the new API + +## [6.0.1] - 2020-05-27 -### New +### Fixes + +- Fix broken ghost coordinates when scrolling, see: [#50] + +## [6.0.0] - 2020-03-08 -- Transfer groupable items between different groups using only list items as drop elements. -- List state invariant: - - the list is gathered by the grouping property - - if there are auxiliary items, they are keep their header or footer places +### Fixes -### Added +- Use fixed `position` instead of absolute for `ghostStyles` in both modules, see: [#50] -- Add new module `DnDList.Groups`. +### Features -* Introduce `Info` type alias with a lot of useful fields. -* Add `info` field to `System`. -* Move `dragIndex` field from `System` to `Info` as a field called `dragIndex`. +- Add `startPosition` and `currentPosition` fields to `Info` in the `DnDList` module only, see: [#65] -- Add `beforeUpdate` field to `Config`. -- Add `listen` field to `Config`. -- Add `operation` field to `Config`. +## [5.0.0] - 2019-05-06 -### Changed +### Features -- Move `message` field from `Config` to `create` function as a new `Msg` argument. +- Reorder items in groupable lists in the module `DnDList.Groups` +- List state invariant: + - the list is gathered by the grouping property + - if there are auxiliary items, they are keep their places as headers or footers -* Rename `Draggable` type to `Model`. -* Rename `draggable` field to `model` in `System`. +* Introduce `Info` type alias with a lot of useful fields +* Add `info` field to `System` ## [4.0.2] - 2019-03-07 -### Fixed +### Fixes -- Instead of `Int` use `Float` when extracting mouse position. -- Delete `preventDefault` from `mouseover` because it has no default action. +- Instead of `Int` use `Float` when extracting mouse coordinates +- Delete `preventDefault` from `mouseover` because it has no default action ## [4.0.1] - 2019-02-21 -### Docs +### Maintenance -- Update README, documentation, and examples for better understanding. +- Update README, documentation, and examples for better understanding ## [4.0.0] - 2019-02-19 -### Changed +### Maintenance -- Rename `draggedIndex` field to `dragIndex` in `System`. +- Rename `draggedIndex` field to `dragIndex` in `System` ## [3.0.0] - 2019-02-18 -### Changed - -- Add `item` type variable to `System`. -- Move `DnDList.update` function into `System` as a new field called `update`. -- Move `DnDList.getDragIndex` function into `System` as a new field called `draggedIndex`. +### Maintenance -* Rename `events` field to `message` in `Config`. +- Add `item` type variable to `System` +- Move `DnDList.update` function into `System` as a new field called `update` +- Move `DnDList.getDragIndex` function into `System` as a new field called `draggedIndex` ## [2.0.0] - 2019-02-17 -### Added +### Maintenance -- Introduce `Config` type alias. -- Replace `Msg` argument with `Config Msg` in `create` function. -- Add the removed `Msg` from `create` to `Config` as a field called `events`. -- Move `Movement` argument from `draggedStyles` to `Config` as a field called `movement`. +- Introduce `Config` type alias ## [1.0.4] - 2019-02-17 -### Docs +### Maintenance -- Add example using `mdgriffith/elm-ui`. +- Add example using `mdgriffith/elm-ui`, see: [#2] ## [1.0.3] - 2019-02-14 -### Docs +### Maintenance -- Update README, documentation, and examples for better understanding. +- Update README, documentation, and examples for better understanding ## [1.0.2] - 2019-02-12 -### Fixed +### Fixes -- The ghost element's position was animated by setting the left and top properties which trigger layout operations, and that's expensive. The better solution is to use a translate on the element, which does not trigger layout. +- Move ghost with `translate` instead of `position`, see: [#1] ## [1.0.1] - 2019-02-08 -- No changes, just check how the Elm package system works. +- No changes, just checking how the Elm package system works ## [1.0.0] - 2019-02-08 -### New - -- Move items in flat lists. -- List state invariant: none +### Features -### Added - -- Add module called `DnDList`. +- Reorder items in flat lists in the module `DnDList` +- List state invariant: none +[7.0.0]: https://github.com/annaghi/dnd-list/compare/6.0.0...7.0.0 [6.0.0]: https://github.com/annaghi/dnd-list/compare/5.0.0...6.0.0 [5.0.0]: https://github.com/annaghi/dnd-list/compare/4.0.2...5.0.0 [4.0.2]: https://github.com/annaghi/dnd-list/compare/4.0.1...4.0.2 @@ -124,3 +117,9 @@ All notable changes to this project will be documented in this file. [1.0.2]: https://github.com/annaghi/dnd-list/compare/1.0.1...1.0.2 [1.0.1]: https://github.com/annaghi/dnd-list/compare/1.0.0...1.0.1 [1.0.0]: https://github.com/annaghi/dnd-list/releases/tag/1.0.0 + + +[#1]: https://github.com/annaghi/dnd-list/pull/1 +[#2]: https://github.com/annaghi/dnd-list/pull/2 +[#50]: https://github.com/annaghi/dnd-list/pull/50 +[#65]: https://github.com/annaghi/dnd-list/pull/65 \ No newline at end of file diff --git a/LICENSE b/LICENSE index 05268f7..0dea991 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ BSD 3-Clause License -Copyright (c) 2019, Anna Bansaghi +Copyright (c) 2019 - 2020, Anna Bansaghi + All rights reserved. Redistribution and use in source and binary forms, with or without @@ -26,4 +27,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/assets/main.js b/docs/assets/main.js index cb2e411..7aa59eb 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -784,11 +784,11 @@ function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.bo.aH === region.bB.aH) + if (region.by.aM === region.bN.aM) { - return 'on line ' + region.bo.aH; + return 'on line ' + region.by.aM; } - return 'on lines ' + region.bo.aH + ' through ' + region.bB.aH; + return 'on lines ' + region.by.aM + ' through ' + region.bN.aM; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.c9, - impl.b9, - impl.b5, + impl.di, + impl.cq, + impl.cm, function() { return function() {} } ); }); @@ -2705,8 +2705,8 @@ var _VirtualDom_mapEventRecord = F2(function(func, record) { return { R: func(record.R), - bp: record.bp, - bj: record.bj + bz: record.bz, + bt: record.bt } }); @@ -2975,10 +2975,10 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) var value = result.a; var message = !tag ? value : tag < 3 ? value.a : value.R; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.bp; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.bz; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.bj) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.bt) && event.preventDefault(), eventNode ); var tagger; @@ -3928,11 +3928,11 @@ var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debug return _Platform_initialize( flagDecoder, args, - impl.c9, - impl.b9, - impl.b5, + impl.di, + impl.cq, + impl.cm, function(sendToApp, initialModel) { - var view = impl.d3; + var view = impl.d7; /**/ var domNode = args['node']; //*/ @@ -3964,12 +3964,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb return _Platform_initialize( flagDecoder, args, - impl.c9, - impl.b9, - impl.b5, + impl.di, + impl.cq, + impl.cm, function(sendToApp, initialModel) { - var divertHrefToApp = impl.bm && impl.bm(sendToApp) - var view = impl.d3; + var divertHrefToApp = impl.bw && impl.bw(sendToApp) + var view = impl.d7; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); @@ -3977,12 +3977,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb { _VirtualDom_divertHrefToApp = divertHrefToApp; var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.cy); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.cO); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.aA) && (_VirtualDom_doc.title = title = doc.aA); + (title !== doc.ai) && (_VirtualDom_doc.title = title = doc.ai); }); } ); @@ -4038,12 +4038,12 @@ function _Browser_makeAnimator(model, draw) function _Browser_application(impl) { - var onUrlChange = impl.dp; - var onUrlRequest = impl.dq; + var onUrlChange = impl.dv; + var onUrlRequest = impl.dw; var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; return _Browser_document({ - bm: function(sendToApp) + bw: function(sendToApp) { key.a = sendToApp; _Browser_window.addEventListener('popstate', key); @@ -4059,9 +4059,9 @@ function _Browser_application(impl) var next = $elm$url$Url$fromString(href).a; sendToApp(onUrlRequest( (next - && curr.bZ === next.bZ - && curr.bI === next.bI - && curr.bW.a === next.bW.a + && curr.cd === next.cd + && curr.bV === next.bV + && curr.ca.a === next.ca.a ) ? $elm$browser$Browser$Internal(next) : $elm$browser$Browser$External(href) @@ -4069,13 +4069,13 @@ function _Browser_application(impl) } }); }, - c9: function(flags) + di: function(flags) { - return A3(impl.c9, flags, _Browser_getUrl(), key); + return A3(impl.di, flags, _Browser_getUrl(), key); }, - d3: impl.d3, - b9: impl.b9, - b5: impl.b5 + d7: impl.d7, + cq: impl.cq, + cm: impl.cm }); } @@ -4141,17 +4141,17 @@ var _Browser_decodeEvent = F2(function(decoder, event) function _Browser_visibilityInfo() { return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { c3: 'hidden', cH: 'visibilitychange' } + ? { dc: 'hidden', cX: 'visibilitychange' } : (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { c3: 'mozHidden', cH: 'mozvisibilitychange' } + ? { dc: 'mozHidden', cX: 'mozvisibilitychange' } : (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { c3: 'msHidden', cH: 'msvisibilitychange' } + ? { dc: 'msHidden', cX: 'msvisibilitychange' } : (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { c3: 'webkitHidden', cH: 'webkitvisibilitychange' } - : { c3: 'hidden', cH: 'visibilitychange' }; + ? { dc: 'webkitHidden', cX: 'webkitvisibilitychange' } + : { dc: 'hidden', cX: 'visibilitychange' }; } @@ -4232,12 +4232,12 @@ var _Browser_call = F2(function(functionName, id) function _Browser_getViewport() { return { - b2: _Browser_getScene(), - cc: { - V: _Browser_window.pageXOffset, - W: _Browser_window.pageYOffset, - d4: _Browser_doc.documentElement.clientWidth, - c2: _Browser_doc.documentElement.clientHeight + ci: _Browser_getScene(), + ct: { + aF: _Browser_window.pageXOffset, + aG: _Browser_window.pageYOffset, + aW: _Browser_doc.documentElement.clientWidth, + db: _Browser_doc.documentElement.clientHeight } }; } @@ -4247,8 +4247,8 @@ function _Browser_getScene() var body = _Browser_doc.body; var elem = _Browser_doc.documentElement; return { - d4: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - c2: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + aW: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + db: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) }; } @@ -4271,15 +4271,15 @@ function _Browser_getViewportOf(id) return _Browser_withNode(id, function(node) { return { - b2: { - d4: node.scrollWidth, - c2: node.scrollHeight + ci: { + aW: node.scrollWidth, + db: node.scrollHeight }, - cc: { - V: node.scrollLeft, - W: node.scrollTop, - d4: node.clientWidth, - c2: node.clientHeight + ct: { + aF: node.scrollLeft, + aG: node.scrollTop, + aW: node.clientWidth, + db: node.clientHeight } }; }); @@ -4309,18 +4309,18 @@ function _Browser_getElement(id) var x = _Browser_window.pageXOffset; var y = _Browser_window.pageYOffset; return { - b2: _Browser_getScene(), - cc: { - V: x, - W: y, - d4: _Browser_doc.documentElement.clientWidth, - c2: _Browser_doc.documentElement.clientHeight + ci: _Browser_getScene(), + ct: { + aF: x, + aG: y, + aW: _Browser_doc.documentElement.clientWidth, + db: _Browser_doc.documentElement.clientHeight }, - cW: { - V: x + rect.left, - W: y + rect.top, - d4: rect.width, - c2: rect.height + c5: { + aF: x + rect.left, + aG: y + rect.top, + aW: rect.width, + db: rect.height } }; }); @@ -4867,25 +4867,25 @@ var $elm$core$Array$treeFromBuilder = F2( }); var $elm$core$Array$builderToArray = F2( function (reverseNodeList, builder) { - if (!builder.c) { + if (!builder.d) { return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.f), + $elm$core$Elm$JsArray$length(builder.g), $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, - builder.f); + builder.g); } else { - var treeLen = builder.c * $elm$core$Array$branchFactor; + var treeLen = builder.d * $elm$core$Array$branchFactor; var depth = $elm$core$Basics$floor( A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); - var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.g) : builder.g; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.c); + var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.i) : builder.i; + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.d); return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.f) + treeLen, + $elm$core$Elm$JsArray$length(builder.g) + treeLen, A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), tree, - builder.f); + builder.g); } }); var $elm$core$Basics$idiv = _Basics_idiv; @@ -4898,7 +4898,7 @@ var $elm$core$Array$initializeHelp = F5( return A2( $elm$core$Array$builderToArray, false, - {g: nodeList, c: (len / $elm$core$Array$branchFactor) | 0, f: tail}); + {i: nodeList, d: (len / $elm$core$Array$branchFactor) | 0, g: tail}); } else { var leaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); @@ -4965,7 +4965,7 @@ var $elm$url$Url$Http = 0; var $elm$url$Url$Https = 1; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {bE: fragment, bI: host, z: path, bW: port_, bZ: protocol, b_: query}; + return {bQ: fragment, bV: host, A: path, ca: port_, cd: protocol, ce: query}; }); var $elm$core$String$contains = _String_contains; var $elm$core$String$length = _String_length; @@ -5247,134 +5247,80 @@ var $elm$browser$Browser$application = _Browser_application; var $author$project$Main$NotFound = {$: 0}; var $elm$core$Platform$Cmd$batch = _Platform_batch; var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); -var $author$project$Config$Root$Movement = function (a) { +var $author$project$DnDList$Parent$HookCommands = function (a) { + return {$: 3, a: a}; +}; +var $author$project$DnDList$Parent$Movement = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$Root$OperationsOnDrag = function (a) { +var $author$project$DnDList$Parent$OperationsOnDrag = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$Root$OperationsOnDrop = function (a) { +var $author$project$DnDList$Parent$OperationsOnDrop = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$Movement$Root$FreeOnDrag = function (a) { +var $author$project$DnDList$HookCommands$Parent$DetectDrop = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$Movement$Root$FreeOnDrop = function (a) { +var $author$project$DnDList$HookCommands$Parent$DetectReorder = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$Movement$Root$HorizontalOnDrag = function (a) { - return {$: 2, a: a}; -}; -var $author$project$Config$Movement$Root$HorizontalOnDrop = function (a) { - return {$: 3, a: a}; -}; -var $author$project$Config$Movement$Root$VerticalOnDrag = function (a) { - return {$: 4, a: a}; -}; -var $author$project$Config$Movement$Root$VerticalOnDrop = function (a) { - return {$: 5, a: a}; -}; -var $author$project$Config$Movement$FreeOnDrag$data = A2( +var $author$project$DnDList$HookCommands$DetectDrop$data = A2( $elm$core$List$map, $elm$core$String$fromInt, - A2($elm$core$List$range, 1, 9)); -var $author$project$Config$Movement$FreeOnDrag$MyMsg = function (a) { + A2($elm$core$List$range, 1, 5)); +var $author$project$DnDList$HookCommands$DetectDrop$DetectDrop = F3( + function (a, b, c) { + return {$: 1, a: a, b: b, c: c}; + }); +var $author$project$DnDList$HookCommands$DetectDrop$DnDMsg = function (a) { return {$: 0, a: a}; }; var $author$project$DnDList$Free = 0; -var $author$project$DnDList$OnDrag = 0; +var $author$project$DnDList$OnDrop = 1; var $author$project$DnDList$Swap = 3; -var $author$project$Config$Movement$FreeOnDrag$config = { - cv: F3( +var $author$project$DnDList$Config = F2( + function (a, b) { + return {$: 0, a: a, b: b}; + }); +var $author$project$DnDList$defaultOptions = { + aJ: $elm$core$Maybe$Nothing, + a4: $elm$core$Maybe$Nothing, + a5: _List_fromArray( + ['width', 'height', 'position']), + aL: F3( function (_v0, _v1, list) { return list; - }), - dg: 0, - dk: 0, - ds: 3 + }) }; -var $author$project$DnDList$Model = $elm$core$Basics$identity; -var $author$project$DnDList$GotDragElement = function (a) { - return {$: 6, a: a}; +var $author$project$DnDList$config = function (settings) { + return A2($author$project$DnDList$Config, settings, $author$project$DnDList$defaultOptions); }; -var $elm$core$Basics$composeL = F3( - function (g, f, x) { - return g( - f(x)); - }); -var $elm$core$Task$onError = _Scheduler_onError; -var $elm$core$Task$attempt = F2( - function (resultToMessage, task) { - return $elm$core$Task$command( - A2( - $elm$core$Task$onError, - A2( - $elm$core$Basics$composeL, - A2($elm$core$Basics$composeL, $elm$core$Task$succeed, resultToMessage), - $elm$core$Result$Err), - A2( - $elm$core$Task$andThen, - A2( - $elm$core$Basics$composeL, - A2($elm$core$Basics$composeL, $elm$core$Task$succeed, resultToMessage), - $elm$core$Result$Ok), - task))); - }); -var $elm$browser$Browser$Dom$getElement = _Browser_getElement; -var $author$project$DnDList$dragElementCommands = F2( - function (stepMsg, state) { - var _v0 = state.P; - if (_v0.$ === 1) { - return A2( - $elm$core$Task$attempt, - A2($elm$core$Basics$composeL, stepMsg, $author$project$DnDList$GotDragElement), - $elm$browser$Browser$Dom$getElement(state.aq)); - } else { - return $elm$core$Platform$Cmd$none; - } - }); -var $author$project$DnDList$GotDropElement = function (a) { - return {$: 7, a: a}; -}; -var $author$project$DnDList$dropElementCommands = F2( - function (stepMsg, state) { - return (!state.n) ? A2( - $elm$core$Task$attempt, - A2($elm$core$Basics$composeL, stepMsg, $author$project$DnDList$GotDropElement), - $elm$browser$Browser$Dom$getElement(state.ac)) : $elm$core$Platform$Cmd$none; - }); -var $author$project$DnDList$commands = F2( - function (stepMsg, _v0) { - var model = _v0; - if (model.$ === 1) { - return $elm$core$Platform$Cmd$none; - } else { - var state = model.a; - return $elm$core$Platform$Cmd$batch( - _List_fromArray( - [ - A2($author$project$DnDList$dragElementCommands, stepMsg, state), - A2($author$project$DnDList$dropElementCommands, stepMsg, state) - ])); - } - }); -var $author$project$DnDList$DragStart = F3( +var $author$project$DnDList$HookCommands$DetectDrop$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 3}); +var $author$project$DnDList$Model = $elm$core$Basics$identity; +var $author$project$DnDList$DownDragItem = F3( function (a, b, c) { return {$: 0, a: a, b: b, c: c}; }); -var $author$project$Internal$Common$Utils$Position = F2( +var $elm$core$Basics$composeR = F3( + function (f, g, x) { + return g( + f(x)); + }); +var $author$project$Internal$Types$Coordinates = F2( function (x, y) { - return {V: x, W: y}; + return {aF: x, aG: y}; }); var $elm$json$Json$Decode$field = _Json_decodeField; var $elm$json$Json$Decode$float = _Json_decodeFloat; -var $author$project$Internal$Common$Utils$pageX = A2($elm$json$Json$Decode$field, 'pageX', $elm$json$Json$Decode$float); -var $author$project$Internal$Common$Utils$pageY = A2($elm$json$Json$Decode$field, 'pageY', $elm$json$Json$Decode$float); -var $author$project$Internal$Common$Utils$decodeCoordinates = A3($elm$json$Json$Decode$map2, $author$project$Internal$Common$Utils$Position, $author$project$Internal$Common$Utils$pageX, $author$project$Internal$Common$Utils$pageY); +var $author$project$Internal$Decoders$pageX = A2($elm$json$Json$Decode$field, 'pageX', $elm$json$Json$Decode$float); +var $author$project$Internal$Decoders$pageY = A2($elm$json$Json$Decode$field, 'pageY', $elm$json$Json$Decode$float); +var $author$project$Internal$Decoders$decodeCoordinates = A3($elm$json$Json$Decode$map2, $author$project$Internal$Types$Coordinates, $author$project$Internal$Decoders$pageX, $author$project$Internal$Decoders$pageY); var $elm$json$Json$Decode$andThen = _Json_andThen; var $elm$json$Json$Decode$fail = _Json_fail; var $elm$json$Json$Decode$int = _Json_decodeInt; -var $author$project$Internal$Common$Utils$decodeMainMouseButton = function (decoder) { +var $author$project$Internal$Decoders$decodeMainMouseButton = function (decoder) { return A2( $elm$json$Json$Decode$andThen, function (button) { @@ -5382,7 +5328,7 @@ var $author$project$Internal$Common$Utils$decodeMainMouseButton = function (deco }, A2($elm$json$Json$Decode$field, 'button', $elm$json$Json$Decode$int)); }; -var $author$project$Internal$Common$Utils$decodeCoordinatesWithButtonCheck = $author$project$Internal$Common$Utils$decodeMainMouseButton($author$project$Internal$Common$Utils$decodeCoordinates); +var $author$project$Internal$Decoders$decodeCoordinatesWithButtonCheck = $author$project$Internal$Decoders$decodeMainMouseButton($author$project$Internal$Decoders$decodeCoordinates); var $elm$virtual_dom$VirtualDom$MayPreventDefault = function (a) { return {$: 2, a: a}; }; @@ -5395,7 +5341,7 @@ var $elm$html$Html$Events$preventDefaultOn = F2( $elm$virtual_dom$VirtualDom$MayPreventDefault(decoder)); }); var $author$project$DnDList$dragEvents = F3( - function (stepMsg, dragIndex, dragElementId) { + function (toMsg, dragIndex, dragElementId) { return _List_fromArray( [ A2( @@ -5409,19 +5355,20 @@ var $author$project$DnDList$dragEvents = F3( A2( $elm$json$Json$Decode$map, A2( - $elm$core$Basics$composeL, - stepMsg, - A2($author$project$DnDList$DragStart, dragIndex, dragElementId)), - $author$project$Internal$Common$Utils$decodeCoordinatesWithButtonCheck))) + $elm$core$Basics$composeR, + A2($author$project$DnDList$DownDragItem, dragIndex, dragElementId), + toMsg), + $author$project$Internal$Decoders$decodeCoordinatesWithButtonCheck))) ]); }); -var $author$project$DnDList$DragEnter = function (a) { - return {$: 3, a: a}; +var $author$project$DnDList$EnterDropItem = {$: 2}; +var $author$project$DnDList$InBetweenMsg = function (a) { + return {$: 1, a: a}; }; -var $author$project$DnDList$DragLeave = {$: 4}; -var $author$project$DnDList$DragOver = F2( +var $author$project$DnDList$LeaveDropItem = {$: 3}; +var $author$project$DnDList$OverDropItem = F2( function (a, b) { - return {$: 2, a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $elm$virtual_dom$VirtualDom$Normal = function (a) { return {$: 0, a: a}; @@ -5452,165 +5399,23 @@ var $elm$html$Html$Events$onMouseOver = function (msg) { $elm$json$Json$Decode$succeed(msg)); }; var $author$project$DnDList$dropEvents = F3( - function (stepMsg, dropIndex, dropElementId) { + function (toMsg, dropIndex, dropElementId) { return _List_fromArray( [ $elm$html$Html$Events$onMouseOver( - stepMsg( - A2($author$project$DnDList$DragOver, dropIndex, dropElementId))), + toMsg( + $author$project$DnDList$InBetweenMsg( + A2($author$project$DnDList$OverDropItem, dropIndex, dropElementId)))), $elm$html$Html$Events$onMouseEnter( - stepMsg( - $author$project$DnDList$DragEnter(dropIndex))), + toMsg( + $author$project$DnDList$InBetweenMsg($author$project$DnDList$EnterDropItem))), $elm$html$Html$Events$onMouseLeave( - stepMsg($author$project$DnDList$DragLeave)) + toMsg( + $author$project$DnDList$InBetweenMsg($author$project$DnDList$LeaveDropItem))) ]); }); -var $author$project$Internal$Common$Utils$px = function (n) { - return $elm$core$String$fromInt(n) + 'px'; -}; -var $elm$core$Basics$round = _Basics_round; -var $elm$virtual_dom$VirtualDom$style = _VirtualDom_style; -var $elm$html$Html$Attributes$style = $elm$virtual_dom$VirtualDom$style; -var $author$project$Internal$Common$Utils$translate = F2( - function (x, y) { - return 'translate3d(' + ($author$project$Internal$Common$Utils$px(x) + (', ' + ($author$project$Internal$Common$Utils$px(y) + ', 0)'))); - }); -var $author$project$DnDList$ghostStyles = F2( - function (movement, _v0) { - var model = _v0; - if (model.$ === 1) { - return _List_Nil; - } else { - var state = model.a; - var _v2 = state.P; - if (!_v2.$) { - var element = _v2.a.cW; - var transform = function () { - switch (movement) { - case 1: - return A2( - $elm$html$Html$Attributes$style, - 'transform', - A2( - $author$project$Internal$Common$Utils$translate, - $elm$core$Basics$round((state.w.V - state.H.V) + element.V), - $elm$core$Basics$round(element.W))); - case 2: - return A2( - $elm$html$Html$Attributes$style, - 'transform', - A2( - $author$project$Internal$Common$Utils$translate, - $elm$core$Basics$round(element.V), - $elm$core$Basics$round((state.w.W - state.H.W) + element.W))); - default: - return A2( - $elm$html$Html$Attributes$style, - 'transform', - A2( - $author$project$Internal$Common$Utils$translate, - $elm$core$Basics$round((state.w.V - state.H.V) + element.V), - $elm$core$Basics$round((state.w.W - state.H.W) + element.W))); - } - }(); - var baseStyles = _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2( - $elm$html$Html$Attributes$style, - 'height', - $author$project$Internal$Common$Utils$px( - $elm$core$Basics$round(element.c2))), - A2( - $elm$html$Html$Attributes$style, - 'width', - $author$project$Internal$Common$Utils$px( - $elm$core$Basics$round(element.d4))), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'none') - ]); - return A2($elm$core$List$cons, transform, baseStyles); - } else { - return _List_Nil; - } - } - }); -var $elm$core$Maybe$andThen = F2( - function (callback, maybeValue) { - if (!maybeValue.$) { - var value = maybeValue.a; - return callback(value); - } else { - return $elm$core$Maybe$Nothing; - } - }); -var $elm$core$Maybe$map2 = F3( - function (func, ma, mb) { - if (ma.$ === 1) { - return $elm$core$Maybe$Nothing; - } else { - var a = ma.a; - if (mb.$ === 1) { - return $elm$core$Maybe$Nothing; - } else { - var b = mb.a; - return $elm$core$Maybe$Just( - A2(func, a, b)); - } - } - }); -var $author$project$DnDList$info = function (_v0) { - var model = _v0; - return A2( - $elm$core$Maybe$andThen, - function (state) { - return A3( - $elm$core$Maybe$map2, - F2( - function (dragElement, dropElement) { - return {w: state.w, P: dragElement, aq: state.aq, a9: state.a9, ab: dropElement, ac: state.ac, cV: state.cV, H: state.H}; - }), - state.P, - state.ab); - }, - model); -}; -var $author$project$DnDList$Drag = function (a) { - return {$: 1, a: a}; -}; -var $author$project$DnDList$DragEnd = {$: 5}; -var $elm$core$Platform$Sub$batch = _Platform_batch; -var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil); -var $elm$browser$Browser$Events$Document = 0; -var $elm$browser$Browser$Events$MySub = F3( - function (a, b, c) { - return {$: 0, a: a, b: b, c: c}; - }); -var $elm$browser$Browser$Events$State = F2( - function (subs, pids) { - return {bV: pids, b4: subs}; - }); var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; -var $elm$browser$Browser$Events$init = $elm$core$Task$succeed( - A2($elm$browser$Browser$Events$State, _List_Nil, $elm$core$Dict$empty)); -var $elm$browser$Browser$Events$nodeToKey = function (node) { - if (!node) { - return 'd_'; - } else { - return 'w_'; - } -}; -var $elm$browser$Browser$Events$addKey = function (sub) { - var node = sub.a; - var name = sub.b; - return _Utils_Tuple2( - _Utils_ap( - $elm$browser$Browser$Events$nodeToKey(node), - name), - sub); -}; var $elm$core$Dict$Black = 1; var $elm$core$Dict$RBNode_elm_builtin = F5( function (a, b, c, d, e) { @@ -5732,7 +5537,381 @@ var $elm$core$Dict$fromList = function (assocs) { $elm$core$Dict$empty, assocs); }; +var $author$project$Internal$Ghost$px = function (n) { + return $elm$core$String$fromInt(n) + 'px'; +}; +var $elm$core$Basics$round = _Basics_round; +var $elm$virtual_dom$VirtualDom$style = _VirtualDom_style; +var $elm$html$Html$Attributes$style = $elm$virtual_dom$VirtualDom$style; +var $author$project$Internal$Ghost$declarations = function (_v0) { + var element = _v0.c5; + return $elm$core$Dict$fromList( + _List_fromArray( + [ + _Utils_Tuple2( + 'width', + _List_fromArray( + [ + A2( + $elm$html$Html$Attributes$style, + 'width', + $author$project$Internal$Ghost$px( + $elm$core$Basics$round(element.aW))) + ])), + _Utils_Tuple2( + 'height', + _List_fromArray( + [ + A2( + $elm$html$Html$Attributes$style, + 'height', + $author$project$Internal$Ghost$px( + $elm$core$Basics$round(element.db))) + ])), + _Utils_Tuple2( + 'position', + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'position', 'fixed'), + A2($elm$html$Html$Attributes$style, 'top', '0'), + A2($elm$html$Html$Attributes$style, 'left', '0') + ])) + ])); +}; +var $elm$core$Dict$get = F2( + function (targetKey, dict) { + get: + while (true) { + if (dict.$ === -2) { + return $elm$core$Maybe$Nothing; + } else { + var key = dict.b; + var value = dict.c; + var left = dict.d; + var right = dict.e; + var _v1 = A2($elm$core$Basics$compare, targetKey, key); + switch (_v1) { + case 0: + var $temp$targetKey = targetKey, + $temp$dict = left; + targetKey = $temp$targetKey; + dict = $temp$dict; + continue get; + case 1: + return $elm$core$Maybe$Just(value); + default: + var $temp$targetKey = targetKey, + $temp$dict = right; + targetKey = $temp$targetKey; + dict = $temp$dict; + continue get; + } + } + } + }); +var $elm$core$Maybe$withDefault = F2( + function (_default, maybe) { + if (!maybe.$) { + var value = maybe.a; + return value; + } else { + return _default; + } + }); +var $author$project$Internal$Ghost$appendDeclarations = F2( + function (element, property) { + return A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2( + $elm$core$Dict$get, + property, + $author$project$Internal$Ghost$declarations(element))); + }); +var $author$project$Internal$Ghost$baseDeclarations = F2( + function (properties, element) { + return A2( + $elm$core$List$cons, + A2($elm$html$Html$Attributes$style, 'pointer-events', 'none'), + A3( + $elm$core$List$foldl, + F2( + function (property, acc) { + return _Utils_ap( + A2($author$project$Internal$Ghost$appendDeclarations, element, property), + acc); + }), + _List_Nil, + properties)); + }); +var $author$project$Internal$Ghost$translate = F2( + function (x, y) { + return 'translate3d(' + ($author$project$Internal$Ghost$px(x) + (', ' + ($author$project$Internal$Ghost$px(y) + ', 0)'))); + }); +var $author$project$DnDList$transformDeclaration = F3( + function (movement, _v0, _v1) { + var x = _v0.aF; + var y = _v0.aG; + var element = _v1.c5; + switch (movement) { + case 1: + return A2( + $elm$html$Html$Attributes$style, + 'transform', + A2( + $author$project$Internal$Ghost$translate, + $elm$core$Basics$round(x + element.aF), + $elm$core$Basics$round(element.aG))); + case 2: + return A2( + $elm$html$Html$Attributes$style, + 'transform', + A2( + $author$project$Internal$Ghost$translate, + $elm$core$Basics$round(element.aF), + $elm$core$Basics$round(y + element.aG))); + default: + return A2( + $elm$html$Html$Attributes$style, + 'transform', + A2( + $author$project$Internal$Ghost$translate, + $elm$core$Basics$round(x + element.aF), + $elm$core$Basics$round(y + element.aG))); + } + }); +var $author$project$DnDList$ghostStyles = F2( + function (_v0, _v1) { + var settings = _v0.a; + var options = _v0.b; + var model = _v1; + if (!model.$) { + var state = model.a; + var _v3 = state.Q; + if (!_v3.$) { + var dragElement = _v3.a; + return A2( + $elm$core$List$cons, + A3($author$project$DnDList$transformDeclaration, settings.b2, state.bd, dragElement), + A2($author$project$Internal$Ghost$baseDeclarations, options.a5, dragElement)); + } else { + return _List_Nil; + } + } else { + return _List_Nil; + } + }); +var $elm$core$Maybe$andThen = F2( + function (callback, maybeValue) { + if (!maybeValue.$) { + var value = maybeValue.a; + return callback(value); + } else { + return $elm$core$Maybe$Nothing; + } + }); +var $elm$core$Maybe$map2 = F3( + function (func, ma, mb) { + if (ma.$ === 1) { + return $elm$core$Maybe$Nothing; + } else { + var a = ma.a; + if (mb.$ === 1) { + return $elm$core$Maybe$Nothing; + } else { + var b = mb.a; + return $elm$core$Maybe$Just( + A2(func, a, b)); + } + } + }); +var $author$project$DnDList$info = function (_v0) { + var model = _v0; + return A2( + $elm$core$Maybe$andThen, + function (state) { + return A3( + $elm$core$Maybe$map2, + F2( + function (dragElement, dropElement) { + return {O: state.O, Q: dragElement, aq: state.aq, c: state.c, _: dropElement, ar: state.ar, h: state.h, ah: state.ah}; + }), + state.Q, + state._); + }, + model); +}; +var $author$project$DnDList$MoveDocument = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDList$Tick = {$: 6}; +var $author$project$DnDList$UpDocument = {$: 2}; +var $elm$core$Basics$always = F2( + function (a, _v0) { + return a; + }); +var $elm$core$Platform$Sub$batch = _Platform_batch; +var $elm$core$Basics$neq = _Utils_notEqual; +var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil); +var $elm$browser$Browser$AnimationManager$Delta = function (a) { + return {$: 1, a: a}; +}; +var $elm$browser$Browser$AnimationManager$State = F3( + function (subs, request, oldTime) { + return {bs: oldTime, cg: request, cl: subs}; + }); +var $elm$browser$Browser$AnimationManager$init = $elm$core$Task$succeed( + A3($elm$browser$Browser$AnimationManager$State, _List_Nil, $elm$core$Maybe$Nothing, 0)); var $elm$core$Process$kill = _Scheduler_kill; +var $elm$browser$Browser$AnimationManager$now = _Browser_now(0); +var $elm$browser$Browser$AnimationManager$rAF = _Browser_rAF(0); +var $elm$core$Platform$sendToSelf = _Platform_sendToSelf; +var $elm$core$Process$spawn = _Scheduler_spawn; +var $elm$browser$Browser$AnimationManager$onEffects = F3( + function (router, subs, _v0) { + var request = _v0.cg; + var oldTime = _v0.bs; + var _v1 = _Utils_Tuple2(request, subs); + if (_v1.a.$ === 1) { + if (!_v1.b.b) { + var _v2 = _v1.a; + return $elm$browser$Browser$AnimationManager$init; + } else { + var _v4 = _v1.a; + return A2( + $elm$core$Task$andThen, + function (pid) { + return A2( + $elm$core$Task$andThen, + function (time) { + return $elm$core$Task$succeed( + A3( + $elm$browser$Browser$AnimationManager$State, + subs, + $elm$core$Maybe$Just(pid), + time)); + }, + $elm$browser$Browser$AnimationManager$now); + }, + $elm$core$Process$spawn( + A2( + $elm$core$Task$andThen, + $elm$core$Platform$sendToSelf(router), + $elm$browser$Browser$AnimationManager$rAF))); + } + } else { + if (!_v1.b.b) { + var pid = _v1.a.a; + return A2( + $elm$core$Task$andThen, + function (_v3) { + return $elm$browser$Browser$AnimationManager$init; + }, + $elm$core$Process$kill(pid)); + } else { + return $elm$core$Task$succeed( + A3($elm$browser$Browser$AnimationManager$State, subs, request, oldTime)); + } + } + }); +var $elm$time$Time$Posix = $elm$core$Basics$identity; +var $elm$time$Time$millisToPosix = $elm$core$Basics$identity; +var $elm$browser$Browser$AnimationManager$onSelfMsg = F3( + function (router, newTime, _v0) { + var subs = _v0.cl; + var oldTime = _v0.bs; + var send = function (sub) { + if (!sub.$) { + var tagger = sub.a; + return A2( + $elm$core$Platform$sendToApp, + router, + tagger( + $elm$time$Time$millisToPosix(newTime))); + } else { + var tagger = sub.a; + return A2( + $elm$core$Platform$sendToApp, + router, + tagger(newTime - oldTime)); + } + }; + return A2( + $elm$core$Task$andThen, + function (pid) { + return A2( + $elm$core$Task$andThen, + function (_v1) { + return $elm$core$Task$succeed( + A3( + $elm$browser$Browser$AnimationManager$State, + subs, + $elm$core$Maybe$Just(pid), + newTime)); + }, + $elm$core$Task$sequence( + A2($elm$core$List$map, send, subs))); + }, + $elm$core$Process$spawn( + A2( + $elm$core$Task$andThen, + $elm$core$Platform$sendToSelf(router), + $elm$browser$Browser$AnimationManager$rAF))); + }); +var $elm$browser$Browser$AnimationManager$Time = function (a) { + return {$: 0, a: a}; +}; +var $elm$core$Basics$composeL = F3( + function (g, f, x) { + return g( + f(x)); + }); +var $elm$browser$Browser$AnimationManager$subMap = F2( + function (func, sub) { + if (!sub.$) { + var tagger = sub.a; + return $elm$browser$Browser$AnimationManager$Time( + A2($elm$core$Basics$composeL, func, tagger)); + } else { + var tagger = sub.a; + return $elm$browser$Browser$AnimationManager$Delta( + A2($elm$core$Basics$composeL, func, tagger)); + } + }); +_Platform_effectManagers['Browser.AnimationManager'] = _Platform_createManager($elm$browser$Browser$AnimationManager$init, $elm$browser$Browser$AnimationManager$onEffects, $elm$browser$Browser$AnimationManager$onSelfMsg, 0, $elm$browser$Browser$AnimationManager$subMap); +var $elm$browser$Browser$AnimationManager$subscription = _Platform_leaf('Browser.AnimationManager'); +var $elm$browser$Browser$AnimationManager$onAnimationFrameDelta = function (tagger) { + return $elm$browser$Browser$AnimationManager$subscription( + $elm$browser$Browser$AnimationManager$Delta(tagger)); +}; +var $elm$browser$Browser$Events$onAnimationFrameDelta = $elm$browser$Browser$AnimationManager$onAnimationFrameDelta; +var $elm$browser$Browser$Events$Document = 0; +var $elm$browser$Browser$Events$MySub = F3( + function (a, b, c) { + return {$: 0, a: a, b: b, c: c}; + }); +var $elm$browser$Browser$Events$State = F2( + function (subs, pids) { + return {b9: pids, cl: subs}; + }); +var $elm$browser$Browser$Events$init = $elm$core$Task$succeed( + A2($elm$browser$Browser$Events$State, _List_Nil, $elm$core$Dict$empty)); +var $elm$browser$Browser$Events$nodeToKey = function (node) { + if (!node) { + return 'd_'; + } else { + return 'w_'; + } +}; +var $elm$browser$Browser$Events$addKey = function (sub) { + var node = sub.a; + var name = sub.b; + return _Utils_Tuple2( + _Utils_ap( + $elm$browser$Browser$Events$nodeToKey(node), + name), + sub); +}; var $elm$core$Dict$foldl = F3( function (func, acc, dict) { foldl: @@ -5821,9 +6000,8 @@ var $elm$core$Dict$merge = F6( }); var $elm$browser$Browser$Events$Event = F2( function (key, event) { - return {bC: event, bf: key}; + return {bO: event, bo: key}; }); -var $elm$core$Platform$sendToSelf = _Platform_sendToSelf; var $elm$browser$Browser$Events$spawn = F3( function (router, key, _v0) { var node = _v0.a; @@ -5896,7 +6074,7 @@ var $elm$browser$Browser$Events$onEffects = F3( stepLeft, stepBoth, stepRight, - state.bV, + state.b9, $elm$core$Dict$fromList(newSubs), _Utils_Tuple3(_List_Nil, $elm$core$Dict$empty, _List_Nil)); var deadPids = _v0.a; @@ -5942,8 +6120,8 @@ var $elm$core$List$filterMap = F2( }); var $elm$browser$Browser$Events$onSelfMsg = F3( function (router, _v0, state) { - var key = _v0.bf; - var event = _v0.bC; + var key = _v0.bo; + var event = _v0.bO; var toMessage = function (_v2) { var subKey = _v2.a; var _v3 = _v2.b; @@ -5952,7 +6130,7 @@ var $elm$browser$Browser$Events$onSelfMsg = F3( var decoder = _v3.c; return _Utils_eq(subKey, key) ? A2(_Browser_decodeEvent, decoder, event) : $elm$core$Maybe$Nothing; }; - var messages = A2($elm$core$List$filterMap, toMessage, state.b4); + var messages = A2($elm$core$List$filterMap, toMessage, state.cl); return A2( $elm$core$Task$andThen, function (_v1) { @@ -5985,25 +6163,54 @@ var $elm$browser$Browser$Events$on = F3( var $elm$browser$Browser$Events$onMouseMove = A2($elm$browser$Browser$Events$on, 0, 'mousemove'); var $elm$browser$Browser$Events$onMouseUp = A2($elm$browser$Browser$Events$on, 0, 'mouseup'); var $author$project$DnDList$subscriptions = F2( - function (stepMsg, _v0) { + function (toMsg, _v0) { var model = _v0; - if (model.$ === 1) { - return $elm$core$Platform$Sub$none; - } else { - return $elm$core$Platform$Sub$batch( - _List_fromArray( - [ - $elm$browser$Browser$Events$onMouseMove( + return (!_Utils_eq(model, $elm$core$Maybe$Nothing)) ? $elm$core$Platform$Sub$batch( + _List_fromArray( + [ + $elm$browser$Browser$Events$onMouseMove( + A2( + $elm$json$Json$Decode$map, A2( - $elm$json$Json$Decode$map, - A2($elm$core$Basics$composeL, stepMsg, $author$project$DnDList$Drag), - $author$project$Internal$Common$Utils$decodeCoordinates)), - $elm$browser$Browser$Events$onMouseUp( - $elm$json$Json$Decode$succeed( - stepMsg($author$project$DnDList$DragEnd))) - ])); - } + $elm$core$Basics$composeR, + $author$project$DnDList$MoveDocument, + A2($elm$core$Basics$composeR, $author$project$DnDList$InBetweenMsg, toMsg)), + $author$project$Internal$Decoders$decodeCoordinates)), + $elm$browser$Browser$Events$onMouseUp( + $elm$json$Json$Decode$succeed( + toMsg($author$project$DnDList$UpDocument))), + $elm$browser$Browser$Events$onAnimationFrameDelta( + A2( + $elm$core$Basics$composeR, + $elm$core$Basics$always($author$project$DnDList$Tick), + A2($elm$core$Basics$composeR, $author$project$DnDList$InBetweenMsg, toMsg))) + ])) : $elm$core$Platform$Sub$none; + }); +var $author$project$DnDList$GotDragItem = function (a) { + return {$: 4, a: a}; +}; +var $author$project$DnDList$GotDropItem = function (a) { + return {$: 5, a: a}; +}; +var $elm$core$Task$onError = _Scheduler_onError; +var $elm$core$Task$attempt = F2( + function (resultToMessage, task) { + return $elm$core$Task$command( + A2( + $elm$core$Task$onError, + A2( + $elm$core$Basics$composeL, + A2($elm$core$Basics$composeL, $elm$core$Task$succeed, resultToMessage), + $elm$core$Result$Err), + A2( + $elm$core$Task$andThen, + A2( + $elm$core$Basics$composeL, + A2($elm$core$Basics$composeL, $elm$core$Task$succeed, resultToMessage), + $elm$core$Result$Ok), + task))); }); +var $elm$browser$Browser$Dom$getElement = _Browser_getElement; var $elm$core$List$drop = F2( function (n, list) { drop: @@ -6151,21 +6358,21 @@ var $elm$core$List$take = F2( function (n, list) { return A3($elm$core$List$takeFast, 0, n, list); }); -var $author$project$Internal$Common$Operations$splitAt = F2( +var $author$project$Internal$Operations$splitAt = F2( function (i, list) { return _Utils_Tuple2( A2($elm$core$List$take, i, list), A2($elm$core$List$drop, i, list)); }); -var $author$project$Internal$Common$Operations$afterBackward = F3( +var $author$project$Internal$Operations$afterBackward = F3( function (i, j, list) { - var _v0 = A2($author$project$Internal$Common$Operations$splitAt, j + 1, list); + var _v0 = A2($author$project$Internal$Operations$splitAt, j + 1, list); var beginning = _v0.a; var rest = _v0.b; - var _v1 = A2($author$project$Internal$Common$Operations$splitAt, (i - j) - 1, rest); + var _v1 = A2($author$project$Internal$Operations$splitAt, (i - j) - 1, rest); var middle = _v1.a; var end = _v1.b; - var _v2 = A2($author$project$Internal$Common$Operations$splitAt, 1, end); + var _v2 = A2($author$project$Internal$Operations$splitAt, 1, end); var head = _v2.a; var tail = _v2.b; return _Utils_ap( @@ -6174,15 +6381,15 @@ var $author$project$Internal$Common$Operations$afterBackward = F3( head, _Utils_ap(middle, tail))); }); -var $author$project$Internal$Common$Operations$afterForward = F3( +var $author$project$Internal$Operations$afterForward = F3( function (i, j, list) { - var _v0 = A2($author$project$Internal$Common$Operations$splitAt, i, list); + var _v0 = A2($author$project$Internal$Operations$splitAt, i, list); var beginning = _v0.a; var rest = _v0.b; - var _v1 = A2($author$project$Internal$Common$Operations$splitAt, (j - i) + 1, rest); + var _v1 = A2($author$project$Internal$Operations$splitAt, (j - i) + 1, rest); var middle = _v1.a; var end = _v1.b; - var _v2 = A2($author$project$Internal$Common$Operations$splitAt, 1, middle); + var _v2 = A2($author$project$Internal$Operations$splitAt, 1, middle); var head = _v2.a; var tail = _v2.b; return _Utils_ap( @@ -6191,19 +6398,19 @@ var $author$project$Internal$Common$Operations$afterForward = F3( tail, _Utils_ap(head, end))); }); -var $author$project$Internal$Common$Operations$insertAfter = F3( +var $author$project$Internal$Operations$insertAfter = F3( function (dragIndex, dropIndex, list) { - return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3($author$project$Internal$Common$Operations$afterForward, dragIndex, dropIndex, list) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3($author$project$Internal$Common$Operations$afterBackward, dragIndex, dropIndex, list) : list); + return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3($author$project$Internal$Operations$afterForward, dragIndex, dropIndex, list) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3($author$project$Internal$Operations$afterBackward, dragIndex, dropIndex, list) : list); }); -var $author$project$Internal$Common$Operations$beforeBackward = F3( +var $author$project$Internal$Operations$beforeBackward = F3( function (i, j, list) { - var _v0 = A2($author$project$Internal$Common$Operations$splitAt, j, list); + var _v0 = A2($author$project$Internal$Operations$splitAt, j, list); var beginning = _v0.a; var rest = _v0.b; - var _v1 = A2($author$project$Internal$Common$Operations$splitAt, i - j, rest); + var _v1 = A2($author$project$Internal$Operations$splitAt, i - j, rest); var middle = _v1.a; var end = _v1.b; - var _v2 = A2($author$project$Internal$Common$Operations$splitAt, 1, end); + var _v2 = A2($author$project$Internal$Operations$splitAt, 1, end); var head = _v2.a; var tail = _v2.b; return _Utils_ap( @@ -6212,15 +6419,15 @@ var $author$project$Internal$Common$Operations$beforeBackward = F3( head, _Utils_ap(middle, tail))); }); -var $author$project$Internal$Common$Operations$beforeForward = F3( +var $author$project$Internal$Operations$beforeForward = F3( function (i, j, list) { - var _v0 = A2($author$project$Internal$Common$Operations$splitAt, i, list); + var _v0 = A2($author$project$Internal$Operations$splitAt, i, list); var beginning = _v0.a; var rest = _v0.b; - var _v1 = A2($author$project$Internal$Common$Operations$splitAt, j - i, rest); + var _v1 = A2($author$project$Internal$Operations$splitAt, j - i, rest); var middle = _v1.a; var end = _v1.b; - var _v2 = A2($author$project$Internal$Common$Operations$splitAt, 1, middle); + var _v2 = A2($author$project$Internal$Operations$splitAt, 1, middle); var head = _v2.a; var tail = _v2.b; return _Utils_ap( @@ -6229,15 +6436,14 @@ var $author$project$Internal$Common$Operations$beforeForward = F3( tail, _Utils_ap(head, end))); }); -var $author$project$Internal$Common$Operations$insertBefore = F3( +var $author$project$Internal$Operations$insertBefore = F3( function (dragIndex, dropIndex, list) { - return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3($author$project$Internal$Common$Operations$beforeForward, dragIndex, dropIndex, list) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3($author$project$Internal$Common$Operations$beforeBackward, dragIndex, dropIndex, list) : list); + return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3($author$project$Internal$Operations$beforeForward, dragIndex, dropIndex, list) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3($author$project$Internal$Operations$beforeBackward, dragIndex, dropIndex, list) : list); }); -var $author$project$Internal$Common$Operations$rotate = F3( +var $author$project$Internal$Operations$rotate = F3( function (dragIndex, dropIndex, list) { - return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3($author$project$Internal$Common$Operations$afterForward, dragIndex, dropIndex, list) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3($author$project$Internal$Common$Operations$beforeBackward, dragIndex, dropIndex, list) : list); + return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3($author$project$Internal$Operations$afterForward, dragIndex, dropIndex, list) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3($author$project$Internal$Operations$beforeBackward, dragIndex, dropIndex, list) : list); }); -var $elm$core$Basics$neq = _Utils_notEqual; var $elm$core$List$append = F2( function (xs, ys) { if (!ys.b) { @@ -6249,7 +6455,7 @@ var $elm$core$List$append = F2( var $elm$core$List$concat = function (lists) { return A3($elm$core$List$foldr, $elm$core$List$append, _List_Nil, lists); }; -var $author$project$Internal$Common$Operations$swapAt = F3( +var $author$project$Internal$Operations$swapAt = F3( function (i, j, list) { var item_j = A2( $elm$core$List$take, @@ -6269,21 +6475,21 @@ var $author$project$Internal$Common$Operations$swapAt = F3( }), list)); }); -var $author$project$Internal$Common$Operations$swap = F3( +var $author$project$Internal$Operations$swap = F3( function (dragIndex, dropIndex, list) { - return (!_Utils_eq(dragIndex, dropIndex)) ? A3($author$project$Internal$Common$Operations$swapAt, dragIndex, dropIndex, list) : list; + return (!_Utils_eq(dragIndex, dropIndex)) ? A3($author$project$Internal$Operations$swapAt, dragIndex, dropIndex, list) : list; }); var $author$project$DnDList$listUpdate = F4( function (operation, dragIndex, dropIndex, list) { switch (operation) { case 0: - return A3($author$project$Internal$Common$Operations$insertAfter, dragIndex, dropIndex, list); + return A3($author$project$Internal$Operations$insertAfter, dragIndex, dropIndex, list); case 1: - return A3($author$project$Internal$Common$Operations$insertBefore, dragIndex, dropIndex, list); + return A3($author$project$Internal$Operations$insertBefore, dragIndex, dropIndex, list); case 2: - return A3($author$project$Internal$Common$Operations$rotate, dragIndex, dropIndex, list); + return A3($author$project$Internal$Operations$rotate, dragIndex, dropIndex, list); case 3: - return A3($author$project$Internal$Common$Operations$swap, dragIndex, dropIndex, list); + return A3($author$project$Internal$Operations$swap, dragIndex, dropIndex, list); default: return list; } @@ -6298,6 +6504,7 @@ var $elm$core$Maybe$map = F2( return $elm$core$Maybe$Nothing; } }); +var $elm$core$Platform$Cmd$map = _Platform_map; var $author$project$DnDList$stateUpdate = F3( function (operation, dropIndex, state) { switch (operation) { @@ -6305,881 +6512,1005 @@ var $author$project$DnDList$stateUpdate = F3( return _Utils_update( state, { - n: 0, - a9: (_Utils_cmp(dropIndex, state.a9) < 0) ? (dropIndex + 1) : dropIndex + c: (_Utils_cmp(dropIndex, state.c) < 0) ? (dropIndex + 1) : dropIndex, + v: 0 }); case 1: return _Utils_update( state, { - n: 0, - a9: (_Utils_cmp(state.a9, dropIndex) < 0) ? (dropIndex - 1) : dropIndex + c: (_Utils_cmp(state.c, dropIndex) < 0) ? (dropIndex - 1) : dropIndex, + v: 0 }); case 2: return _Utils_update( state, - {n: 0, a9: dropIndex}); + {c: dropIndex, v: 0}); case 3: return _Utils_update( state, - {n: 0, a9: dropIndex}); + {c: dropIndex, v: 0}); default: return _Utils_update( state, - {n: 0}); + {v: 0}); } }); -var $author$project$DnDList$update = F4( - function (_v0, msg, _v1, list) { - var beforeUpdate = _v0.cv; - var listen = _v0.dg; - var operation = _v0.ds; - var model = _v1; +var $author$project$DnDList$inBetweenUpdate = F6( + function (settings, options, toMsg, list, msg, state) { switch (msg.$) { case 0: - var dragIndex = msg.a; - var dragElementId = msg.b; - var xy = msg.c; - return _Utils_Tuple2( - $elm$core$Maybe$Just( - {w: xy, n: 0, P: $elm$core$Maybe$Nothing, aq: dragElementId, a9: dragIndex, ab: $elm$core$Maybe$Nothing, ac: dragElementId, cV: dragIndex, H: xy}), - list); + var coordinates = msg.a; + return _Utils_Tuple3( + list, + _Utils_update( + state, + {O: coordinates, v: state.v + 1}), + _Utils_eq(state.Q, $elm$core$Maybe$Nothing) ? A2( + $elm$core$Platform$Cmd$map, + A2($elm$core$Basics$composeR, $author$project$DnDList$InBetweenMsg, toMsg), + A2( + $elm$core$Task$attempt, + $author$project$DnDList$GotDragItem, + $elm$browser$Browser$Dom$getElement(state.aq))) : $elm$core$Platform$Cmd$none); case 1: - var xy = msg.a; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {w: xy, n: state.n + 1}); - }, - model), - list); - case 2: var dropIndex = msg.a; var dropElementId = msg.b; - return _Utils_Tuple2( + return _Utils_Tuple3( + list, + _Utils_update( + state, + {ar: dropElementId, h: dropIndex}), A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {ac: dropElementId, cV: dropIndex}); - }, - model), - list); - case 3: - var dropIndex = msg.a; - var _v3 = _Utils_Tuple2(model, listen); - if ((!_v3.a.$) && (!_v3.b)) { - var state = _v3.a.a; - var _v4 = _v3.b; - return ((state.n > 1) && (!_Utils_eq(state.a9, dropIndex))) ? _Utils_Tuple2( - $elm$core$Maybe$Just( - A3($author$project$DnDList$stateUpdate, operation, dropIndex, state)), - A4( - $author$project$DnDList$listUpdate, - operation, - state.a9, - dropIndex, - A3(beforeUpdate, state.a9, dropIndex, list))) : _Utils_Tuple2(model, list); - } else { - return _Utils_Tuple2( + $elm$core$Platform$Cmd$map, + A2($elm$core$Basics$composeR, $author$project$DnDList$InBetweenMsg, toMsg), A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {n: 0}); - }, - model), - list); - } - case 4: - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {cV: state.a9}); - }, - model), - list); - case 5: - var _v5 = _Utils_Tuple2(model, listen); - if ((!_v5.a.$) && (_v5.b === 1)) { - var state = _v5.a.a; - var _v6 = _v5.b; - return (!_Utils_eq(state.a9, state.cV)) ? _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A4( + $elm$core$Task$attempt, + $author$project$DnDList$GotDropItem, + $elm$browser$Browser$Dom$getElement(dropElementId)))); + case 2: + if ((state.v > 1) && (!_Utils_eq(state.c, state.h))) { + var _v1 = settings.bp; + if (!_v1) { + var newList = A4( $author$project$DnDList$listUpdate, - operation, - state.a9, - state.cV, - A3(beforeUpdate, state.a9, state.cV, list))) : _Utils_Tuple2($elm$core$Maybe$Nothing, list); + settings.a9, + state.c, + state.h, + A3(options.aL, state.c, state.h, list)); + return _Utils_Tuple3( + newList, + A3($author$project$DnDList$stateUpdate, settings.a9, state.h, state), + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(newList)); + }, + options.a4))); + } else { + return _Utils_Tuple3( + list, + _Utils_update( + state, + {v: 0}), + $elm$core$Platform$Cmd$none); + } } else { - return _Utils_Tuple2($elm$core$Maybe$Nothing, list); + return _Utils_Tuple3(list, state, $elm$core$Platform$Cmd$none); } - case 6: + case 3: + return _Utils_Tuple3( + list, + _Utils_update( + state, + {h: state.c}), + $elm$core$Platform$Cmd$none); + case 4: if (msg.a.$ === 1) { - return _Utils_Tuple2(model, list); + return _Utils_Tuple3(list, state, $elm$core$Platform$Cmd$none); } else { var dragElement = msg.a.a; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - { - P: $elm$core$Maybe$Just(dragElement), - ab: $elm$core$Maybe$Just(dragElement) - }); - }, - model), - list); + return _Utils_Tuple3( + list, + _Utils_update( + state, + { + Q: $elm$core$Maybe$Just(dragElement), + _: $elm$core$Maybe$Just(dragElement) + }), + $elm$core$Platform$Cmd$none); } - default: + case 5: if (msg.a.$ === 1) { - return _Utils_Tuple2(model, list); + return _Utils_Tuple3(list, state, $elm$core$Platform$Cmd$none); } else { var dropElement = msg.a.a; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - { - ab: $elm$core$Maybe$Just(dropElement) - }); - }, - model), - list); + return _Utils_Tuple3( + list, + _Utils_update( + state, + { + _: $elm$core$Maybe$Just(dropElement) + }), + $elm$core$Platform$Cmd$none); + } + default: + return _Utils_Tuple3( + list, + _Utils_update( + state, + { + bd: A2($author$project$Internal$Types$Coordinates, state.O.aF - state.ah.aF, state.O.aG - state.ah.aG) + }), + $elm$core$Platform$Cmd$none); + } + }); +var $author$project$DnDList$update = F5( + function (_v0, toMsg, list, msg, _v1) { + var settings = _v0.a; + var options = _v0.b; + var model = _v1; + switch (msg.$) { + case 0: + var dragIndex = msg.a; + var dragElementId = msg.b; + var coordinates = msg.c; + return _Utils_Tuple3( + list, + $elm$core$Maybe$Just( + { + O: coordinates, + Q: $elm$core$Maybe$Nothing, + aq: dragElementId, + c: dragIndex, + _: $elm$core$Maybe$Nothing, + ar: dragElementId, + h: dragIndex, + v: 0, + ah: coordinates, + bd: A2($author$project$Internal$Types$Coordinates, 0, 0) + }), + $elm$core$Platform$Cmd$none); + case 1: + var inBetweenMsg = msg.a; + if (!model.$) { + var state = model.a; + var _v4 = A6($author$project$DnDList$inBetweenUpdate, settings, options, toMsg, list, inBetweenMsg, state); + var newList = _v4.a; + var newState = _v4.b; + var newCmd = _v4.c; + return _Utils_Tuple3( + newList, + $elm$core$Maybe$Just(newState), + newCmd); + } else { + return _Utils_Tuple3(list, $elm$core$Maybe$Nothing, $elm$core$Platform$Cmd$none); + } + default: + if (!model.$) { + var state = model.a; + if (!_Utils_eq(state.c, state.h)) { + var _v6 = settings.bp; + if (!_v6) { + return _Utils_Tuple3(list, $elm$core$Maybe$Nothing, $elm$core$Platform$Cmd$none); + } else { + var newList = A4( + $author$project$DnDList$listUpdate, + settings.a9, + state.c, + state.h, + A3(options.aL, state.c, state.h, list)); + return _Utils_Tuple3( + newList, + $elm$core$Maybe$Nothing, + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(newList)); + }, + options.aJ))); + } + } else { + return _Utils_Tuple3( + list, + $elm$core$Maybe$Nothing, + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(list)); + }, + options.aJ))); + } + } else { + return _Utils_Tuple3(list, $elm$core$Maybe$Nothing, $elm$core$Platform$Cmd$none); } } }); var $author$project$DnDList$create = F2( - function (config, stepMsg) { + function (toMsg, configuration) { return { - cM: $author$project$DnDList$commands(stepMsg), - cT: $author$project$DnDList$dragEvents(stepMsg), - cU: $author$project$DnDList$dropEvents(stepMsg), - c$: $author$project$DnDList$ghostStyles(config.dk), - be: $author$project$DnDList$info, - dj: $elm$core$Maybe$Nothing, - b5: $author$project$DnDList$subscriptions(stepMsg), - b9: $author$project$DnDList$update(config) + bL: $author$project$DnDList$dragEvents(toMsg), + bM: $author$project$DnDList$dropEvents(toMsg), + bS: $author$project$DnDList$ghostStyles(configuration), + bX: $author$project$DnDList$info, + b0: $elm$core$Maybe$Nothing, + cm: $author$project$DnDList$subscriptions(toMsg), + cq: A2($author$project$DnDList$update, configuration, toMsg) }; }); -var $author$project$Config$Movement$FreeOnDrag$system = A2($author$project$DnDList$create, $author$project$Config$Movement$FreeOnDrag$config, $author$project$Config$Movement$FreeOnDrag$MyMsg); -var $author$project$Config$Movement$FreeOnDrag$initialModel = {I: _List_Nil, aa: $author$project$Config$Movement$FreeOnDrag$system.dj, au: $author$project$Config$Movement$FreeOnDrag$data}; -var $author$project$Config$Movement$FreeOnDrop$data = A2( +var $author$project$DnDList$detectDrop = F2( + function (hook, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Config, + settings, + _Utils_update( + options, + { + aJ: $elm$core$Maybe$Just(hook) + })); + }); +var $author$project$DnDList$HookCommands$DetectDrop$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$HookCommands$DetectDrop$DnDMsg, + A2($author$project$DnDList$detectDrop, $author$project$DnDList$HookCommands$DetectDrop$DetectDrop, $author$project$DnDList$HookCommands$DetectDrop$config)); +var $author$project$DnDList$HookCommands$DetectDrop$initialModel = {Z: $author$project$DnDList$HookCommands$DetectDrop$system.b0, aK: _List_Nil, av: $author$project$DnDList$HookCommands$DetectDrop$data}; +var $author$project$DnDList$HookCommands$DetectReorder$data = A2( + $elm$core$List$map, + $elm$core$String$fromInt, + A2($elm$core$List$range, 1, 5)); +var $author$project$DnDList$HookCommands$DetectReorder$DetectReorder = F3( + function (a, b, c) { + return {$: 1, a: a, b: b, c: c}; + }); +var $author$project$DnDList$HookCommands$DetectReorder$DnDMsg = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDList$OnDrag = 0; +var $author$project$DnDList$HookCommands$DetectReorder$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$DnDList$detectReorder = F2( + function (hook, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Config, + settings, + _Utils_update( + options, + { + a4: $elm$core$Maybe$Just(hook) + })); + }); +var $author$project$DnDList$HookCommands$DetectReorder$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$HookCommands$DetectReorder$DnDMsg, + A2($author$project$DnDList$detectReorder, $author$project$DnDList$HookCommands$DetectReorder$DetectReorder, $author$project$DnDList$HookCommands$DetectReorder$config)); +var $author$project$DnDList$HookCommands$DetectReorder$initialModel = {Z: $author$project$DnDList$HookCommands$DetectReorder$system.b0, aK: _List_Nil, av: $author$project$DnDList$HookCommands$DetectReorder$data}; +var $author$project$DnDList$HookCommands$Parent$initialModel = { + at: _List_fromArray( + [ + $author$project$DnDList$HookCommands$Parent$DetectDrop($author$project$DnDList$HookCommands$DetectDrop$initialModel), + $author$project$DnDList$HookCommands$Parent$DetectReorder($author$project$DnDList$HookCommands$DetectReorder$initialModel) + ]), + a7: 0 +}; +var $author$project$DnDList$Movement$Parent$FreeOnDrag = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDList$Movement$Parent$FreeOnDrop = function (a) { + return {$: 1, a: a}; +}; +var $author$project$DnDList$Movement$Parent$HorizontalOnDrag = function (a) { + return {$: 2, a: a}; +}; +var $author$project$DnDList$Movement$Parent$HorizontalOnDrop = function (a) { + return {$: 3, a: a}; +}; +var $author$project$DnDList$Movement$Parent$VerticalOnDrag = function (a) { + return {$: 4, a: a}; +}; +var $author$project$DnDList$Movement$Parent$VerticalOnDrop = function (a) { + return {$: 5, a: a}; +}; +var $author$project$DnDList$Movement$FreeOnDrag$data = A2( $elm$core$List$map, $elm$core$String$fromInt, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$Movement$FreeOnDrop$MyMsg = function (a) { +var $author$project$DnDList$Movement$FreeOnDrag$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$OnDrop = 1; -var $author$project$Config$Movement$FreeOnDrop$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 1, - dk: 0, - ds: 3 -}; -var $author$project$Config$Movement$FreeOnDrop$system = A2($author$project$DnDList$create, $author$project$Config$Movement$FreeOnDrop$config, $author$project$Config$Movement$FreeOnDrop$MyMsg); -var $author$project$Config$Movement$FreeOnDrop$initialModel = {I: _List_Nil, aa: $author$project$Config$Movement$FreeOnDrop$system.dj, au: $author$project$Config$Movement$FreeOnDrop$data}; -var $author$project$Config$Movement$HorizontalOnDrag$data = A2( +var $author$project$DnDList$Movement$FreeOnDrag$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$DnDList$Movement$FreeOnDrag$system = A2($author$project$DnDList$create, $author$project$DnDList$Movement$FreeOnDrag$DnDMsg, $author$project$DnDList$Movement$FreeOnDrag$config); +var $author$project$DnDList$Movement$FreeOnDrag$initialModel = {I: _List_Nil, Z: $author$project$DnDList$Movement$FreeOnDrag$system.b0, av: $author$project$DnDList$Movement$FreeOnDrag$data}; +var $author$project$DnDList$Movement$FreeOnDrop$data = A2( + $elm$core$List$map, + $elm$core$String$fromInt, + A2($elm$core$List$range, 1, 9)); +var $author$project$DnDList$Movement$FreeOnDrop$DnDMsg = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDList$Movement$FreeOnDrop$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 3}); +var $author$project$DnDList$Movement$FreeOnDrop$system = A2($author$project$DnDList$create, $author$project$DnDList$Movement$FreeOnDrop$DnDMsg, $author$project$DnDList$Movement$FreeOnDrop$config); +var $author$project$DnDList$Movement$FreeOnDrop$initialModel = {I: _List_Nil, Z: $author$project$DnDList$Movement$FreeOnDrop$system.b0, av: $author$project$DnDList$Movement$FreeOnDrop$data}; +var $author$project$DnDList$Movement$HorizontalOnDrag$data = A2( $elm$core$List$map, $elm$core$String$fromInt, A2($elm$core$List$range, 1, 7)); -var $author$project$Config$Movement$HorizontalOnDrag$MyMsg = function (a) { +var $author$project$DnDList$Movement$HorizontalOnDrag$DnDMsg = function (a) { return {$: 0, a: a}; }; var $author$project$DnDList$Horizontal = 1; -var $author$project$Config$Movement$HorizontalOnDrag$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 1, - ds: 3 -}; -var $author$project$Config$Movement$HorizontalOnDrag$system = A2($author$project$DnDList$create, $author$project$Config$Movement$HorizontalOnDrag$config, $author$project$Config$Movement$HorizontalOnDrag$MyMsg); -var $author$project$Config$Movement$HorizontalOnDrag$initialModel = {I: _List_Nil, aa: $author$project$Config$Movement$HorizontalOnDrag$system.dj, au: $author$project$Config$Movement$HorizontalOnDrag$data}; -var $author$project$Config$Movement$HorizontalOnDrop$data = A2( +var $author$project$DnDList$Movement$HorizontalOnDrag$config = $author$project$DnDList$config( + {bp: 0, b2: 1, a9: 3}); +var $author$project$DnDList$Movement$HorizontalOnDrag$system = A2($author$project$DnDList$create, $author$project$DnDList$Movement$HorizontalOnDrag$DnDMsg, $author$project$DnDList$Movement$HorizontalOnDrag$config); +var $author$project$DnDList$Movement$HorizontalOnDrag$initialModel = {I: _List_Nil, Z: $author$project$DnDList$Movement$HorizontalOnDrag$system.b0, av: $author$project$DnDList$Movement$HorizontalOnDrag$data}; +var $author$project$DnDList$Movement$HorizontalOnDrop$data = A2( $elm$core$List$map, $elm$core$String$fromInt, A2($elm$core$List$range, 1, 7)); -var $author$project$Config$Movement$HorizontalOnDrop$MyMsg = function (a) { +var $author$project$DnDList$Movement$HorizontalOnDrop$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$Movement$HorizontalOnDrop$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 1, - dk: 1, - ds: 3 -}; -var $author$project$Config$Movement$HorizontalOnDrop$system = A2($author$project$DnDList$create, $author$project$Config$Movement$HorizontalOnDrop$config, $author$project$Config$Movement$HorizontalOnDrop$MyMsg); -var $author$project$Config$Movement$HorizontalOnDrop$initialModel = {I: _List_Nil, aa: $author$project$Config$Movement$HorizontalOnDrop$system.dj, au: $author$project$Config$Movement$HorizontalOnDrop$data}; -var $author$project$Config$Movement$VerticalOnDrag$data = A2( +var $author$project$DnDList$Movement$HorizontalOnDrop$config = $author$project$DnDList$config( + {bp: 1, b2: 1, a9: 3}); +var $author$project$DnDList$Movement$HorizontalOnDrop$system = A2($author$project$DnDList$create, $author$project$DnDList$Movement$HorizontalOnDrop$DnDMsg, $author$project$DnDList$Movement$HorizontalOnDrop$config); +var $author$project$DnDList$Movement$HorizontalOnDrop$initialModel = {I: _List_Nil, Z: $author$project$DnDList$Movement$HorizontalOnDrop$system.b0, av: $author$project$DnDList$Movement$HorizontalOnDrop$data}; +var $author$project$DnDList$Movement$VerticalOnDrag$data = A2( $elm$core$List$map, $elm$core$String$fromInt, A2($elm$core$List$range, 1, 7)); -var $author$project$Config$Movement$VerticalOnDrag$MyMsg = function (a) { +var $author$project$DnDList$Movement$VerticalOnDrag$DnDMsg = function (a) { return {$: 0, a: a}; }; var $author$project$DnDList$Vertical = 2; -var $author$project$Config$Movement$VerticalOnDrag$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 2, - ds: 3 -}; -var $author$project$Config$Movement$VerticalOnDrag$system = A2($author$project$DnDList$create, $author$project$Config$Movement$VerticalOnDrag$config, $author$project$Config$Movement$VerticalOnDrag$MyMsg); -var $author$project$Config$Movement$VerticalOnDrag$initialModel = {I: _List_Nil, aa: $author$project$Config$Movement$VerticalOnDrag$system.dj, au: $author$project$Config$Movement$VerticalOnDrag$data}; -var $author$project$Config$Movement$VerticalOnDrop$data = A2( +var $author$project$DnDList$Movement$VerticalOnDrag$config = $author$project$DnDList$config( + {bp: 0, b2: 2, a9: 3}); +var $author$project$DnDList$Movement$VerticalOnDrag$system = A2($author$project$DnDList$create, $author$project$DnDList$Movement$VerticalOnDrag$DnDMsg, $author$project$DnDList$Movement$VerticalOnDrag$config); +var $author$project$DnDList$Movement$VerticalOnDrag$initialModel = {I: _List_Nil, Z: $author$project$DnDList$Movement$VerticalOnDrag$system.b0, av: $author$project$DnDList$Movement$VerticalOnDrag$data}; +var $author$project$DnDList$Movement$VerticalOnDrop$data = A2( $elm$core$List$map, $elm$core$String$fromInt, A2($elm$core$List$range, 1, 7)); -var $author$project$Config$Movement$VerticalOnDrop$MyMsg = function (a) { +var $author$project$DnDList$Movement$VerticalOnDrop$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$Movement$VerticalOnDrop$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 1, - dk: 2, - ds: 3 -}; -var $author$project$Config$Movement$VerticalOnDrop$system = A2($author$project$DnDList$create, $author$project$Config$Movement$VerticalOnDrop$config, $author$project$Config$Movement$VerticalOnDrop$MyMsg); -var $author$project$Config$Movement$VerticalOnDrop$initialModel = {I: _List_Nil, aa: $author$project$Config$Movement$VerticalOnDrop$system.dj, au: $author$project$Config$Movement$VerticalOnDrop$data}; -var $author$project$Config$Movement$Root$initialModel = { - Q: _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$config = $author$project$DnDList$config( + {bp: 1, b2: 2, a9: 3}); +var $author$project$DnDList$Movement$VerticalOnDrop$system = A2($author$project$DnDList$create, $author$project$DnDList$Movement$VerticalOnDrop$DnDMsg, $author$project$DnDList$Movement$VerticalOnDrop$config); +var $author$project$DnDList$Movement$VerticalOnDrop$initialModel = {I: _List_Nil, Z: $author$project$DnDList$Movement$VerticalOnDrop$system.b0, av: $author$project$DnDList$Movement$VerticalOnDrop$data}; +var $author$project$DnDList$Movement$Parent$initialModel = { + at: _List_fromArray( [ - $author$project$Config$Movement$Root$FreeOnDrag($author$project$Config$Movement$FreeOnDrag$initialModel), - $author$project$Config$Movement$Root$FreeOnDrop($author$project$Config$Movement$FreeOnDrop$initialModel), - $author$project$Config$Movement$Root$HorizontalOnDrag($author$project$Config$Movement$HorizontalOnDrag$initialModel), - $author$project$Config$Movement$Root$HorizontalOnDrop($author$project$Config$Movement$HorizontalOnDrop$initialModel), - $author$project$Config$Movement$Root$VerticalOnDrag($author$project$Config$Movement$VerticalOnDrag$initialModel), - $author$project$Config$Movement$Root$VerticalOnDrop($author$project$Config$Movement$VerticalOnDrop$initialModel) + $author$project$DnDList$Movement$Parent$FreeOnDrag($author$project$DnDList$Movement$FreeOnDrag$initialModel), + $author$project$DnDList$Movement$Parent$FreeOnDrop($author$project$DnDList$Movement$FreeOnDrop$initialModel), + $author$project$DnDList$Movement$Parent$HorizontalOnDrag($author$project$DnDList$Movement$HorizontalOnDrag$initialModel), + $author$project$DnDList$Movement$Parent$HorizontalOnDrop($author$project$DnDList$Movement$HorizontalOnDrop$initialModel), + $author$project$DnDList$Movement$Parent$VerticalOnDrag($author$project$DnDList$Movement$VerticalOnDrag$initialModel), + $author$project$DnDList$Movement$Parent$VerticalOnDrop($author$project$DnDList$Movement$VerticalOnDrop$initialModel) ]), - at: 0 + a7: 0 }; -var $author$project$Config$OperationsOnDrag$Root$InsertAfter = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$InsertAfter = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$InsertBefore = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$InsertBefore = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$Rotate = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$Rotate = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$Swap = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$Swap = function (a) { return {$: 3, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$Unaltered = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$Unaltered = function (a) { return {$: 4, a: a}; }; -var $author$project$Config$OperationsOnDrag$InsertAfter$Item = F2( +var $author$project$DnDList$OperationsOnDrag$InsertAfter$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrag$InsertAfter$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrag$InsertAfter$data = A2( +var $author$project$DnDList$OperationsOnDrag$InsertAfter$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrag$InsertAfter$Item, + $author$project$DnDList$OperationsOnDrag$InsertAfter$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrag$InsertAfter$baseColor); + $author$project$DnDList$OperationsOnDrag$InsertAfter$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrag$InsertAfter$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$InsertAfter$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$InsertAfter = 0; -var $author$project$Config$OperationsOnDrag$InsertAfter$affectedColor = 'purple'; -var $author$project$Config$OperationsOnDrag$InsertAfter$dragColor = 'red'; -var $author$project$Config$OperationsOnDrag$InsertAfter$dropColor = 'green'; -var $author$project$Config$OperationsOnDrag$InsertAfter$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrag$InsertAfter$affectedColor = 'purple'; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - var color = _v0.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$affectedColor) : A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, color))); + var value = _v0.aC; + var color = _v0.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$affectedColor) : A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, color))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - var color = _v1.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$affectedColor) : A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, color))); + var value = _v1.aC; + var color = _v1.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$affectedColor) : A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, color))); }), items) : items); }); -var $author$project$Config$OperationsOnDrag$InsertAfter$config = {cv: $author$project$Config$OperationsOnDrag$InsertAfter$beforeUpdate, dg: 0, dk: 0, ds: 0}; -var $author$project$Config$OperationsOnDrag$InsertAfter$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrag$InsertAfter$config, $author$project$Config$OperationsOnDrag$InsertAfter$MyMsg); -var $author$project$Config$OperationsOnDrag$InsertAfter$initialModel = {aa: $author$project$Config$OperationsOnDrag$InsertAfter$system.dj, au: $author$project$Config$OperationsOnDrag$InsertAfter$data}; -var $author$project$Config$OperationsOnDrag$InsertBefore$Item = F2( +var $author$project$DnDList$InsertAfter = 0; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 0}); +var $author$project$DnDList$hookItemsBeforeListUpdate = F2( + function (hook, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Config, + settings, + _Utils_update( + options, + {aL: hook})); + }); +var $author$project$DnDList$OperationsOnDrag$InsertAfter$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrag$InsertAfter$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrag$InsertAfter$beforeUpdate, $author$project$DnDList$OperationsOnDrag$InsertAfter$config)); +var $author$project$DnDList$OperationsOnDrag$InsertAfter$initialModel = {Z: $author$project$DnDList$OperationsOnDrag$InsertAfter$system.b0, av: $author$project$DnDList$OperationsOnDrag$InsertAfter$data}; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrag$InsertBefore$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrag$InsertBefore$data = A2( +var $author$project$DnDList$OperationsOnDrag$InsertBefore$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrag$InsertBefore$Item, + $author$project$DnDList$OperationsOnDrag$InsertBefore$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrag$InsertBefore$baseColor); + $author$project$DnDList$OperationsOnDrag$InsertBefore$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrag$InsertBefore$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$InsertBefore$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$InsertBefore = 1; -var $author$project$Config$OperationsOnDrag$InsertBefore$affectedColor = 'purple'; -var $author$project$Config$OperationsOnDrag$InsertBefore$dragColor = 'red'; -var $author$project$Config$OperationsOnDrag$InsertBefore$dropColor = 'green'; -var $author$project$Config$OperationsOnDrag$InsertBefore$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrag$InsertBefore$affectedColor = 'purple'; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - var color = _v0.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$affectedColor) : A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, color))); + var value = _v0.aC; + var color = _v0.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$affectedColor) : A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, color))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - var color = _v1.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$affectedColor) : A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, color))); + var value = _v1.aC; + var color = _v1.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$affectedColor) : A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, color))); }), items) : items); }); -var $author$project$Config$OperationsOnDrag$InsertBefore$config = {cv: $author$project$Config$OperationsOnDrag$InsertBefore$beforeUpdate, dg: 0, dk: 0, ds: 1}; -var $author$project$Config$OperationsOnDrag$InsertBefore$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrag$InsertBefore$config, $author$project$Config$OperationsOnDrag$InsertBefore$MyMsg); -var $author$project$Config$OperationsOnDrag$InsertBefore$initialModel = {aa: $author$project$Config$OperationsOnDrag$InsertBefore$system.dj, au: $author$project$Config$OperationsOnDrag$InsertBefore$data}; -var $author$project$Config$OperationsOnDrag$Rotate$Item = F2( +var $author$project$DnDList$InsertBefore = 1; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 1}); +var $author$project$DnDList$OperationsOnDrag$InsertBefore$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrag$InsertBefore$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrag$InsertBefore$beforeUpdate, $author$project$DnDList$OperationsOnDrag$InsertBefore$config)); +var $author$project$DnDList$OperationsOnDrag$InsertBefore$initialModel = {Z: $author$project$DnDList$OperationsOnDrag$InsertBefore$system.b0, av: $author$project$DnDList$OperationsOnDrag$InsertBefore$data}; +var $author$project$DnDList$OperationsOnDrag$Rotate$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrag$Rotate$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrag$Rotate$data = A2( +var $author$project$DnDList$OperationsOnDrag$Rotate$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrag$Rotate$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrag$Rotate$Item, + $author$project$DnDList$OperationsOnDrag$Rotate$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrag$Rotate$baseColor); + $author$project$DnDList$OperationsOnDrag$Rotate$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrag$Rotate$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Rotate$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$Rotate = 2; -var $author$project$Config$OperationsOnDrag$Rotate$affectedColor = 'purple'; -var $author$project$Config$OperationsOnDrag$Rotate$dragColor = 'red'; -var $author$project$Config$OperationsOnDrag$Rotate$dropColor = 'green'; -var $author$project$Config$OperationsOnDrag$Rotate$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrag$Rotate$affectedColor = 'purple'; +var $author$project$DnDList$OperationsOnDrag$Rotate$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrag$Rotate$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrag$Rotate$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - var color = _v0.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$affectedColor) : A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, color))); + var value = _v0.aC; + var color = _v0.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$affectedColor) : A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, color))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - var color = _v1.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$affectedColor) : A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, color))); + var value = _v1.aC; + var color = _v1.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$affectedColor) : A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, color))); }), items) : items); }); -var $author$project$Config$OperationsOnDrag$Rotate$config = {cv: $author$project$Config$OperationsOnDrag$Rotate$beforeUpdate, dg: 0, dk: 0, ds: 2}; -var $author$project$Config$OperationsOnDrag$Rotate$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrag$Rotate$config, $author$project$Config$OperationsOnDrag$Rotate$MyMsg); -var $author$project$Config$OperationsOnDrag$Rotate$initialModel = {aa: $author$project$Config$OperationsOnDrag$Rotate$system.dj, au: $author$project$Config$OperationsOnDrag$Rotate$data}; -var $author$project$Config$OperationsOnDrag$Swap$Item = F2( +var $author$project$DnDList$Rotate = 2; +var $author$project$DnDList$OperationsOnDrag$Rotate$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 2}); +var $author$project$DnDList$OperationsOnDrag$Rotate$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrag$Rotate$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrag$Rotate$beforeUpdate, $author$project$DnDList$OperationsOnDrag$Rotate$config)); +var $author$project$DnDList$OperationsOnDrag$Rotate$initialModel = {Z: $author$project$DnDList$OperationsOnDrag$Rotate$system.b0, av: $author$project$DnDList$OperationsOnDrag$Rotate$data}; +var $author$project$DnDList$OperationsOnDrag$Swap$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrag$Swap$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrag$Swap$data = A2( +var $author$project$DnDList$OperationsOnDrag$Swap$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrag$Swap$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrag$Swap$Item, + $author$project$DnDList$OperationsOnDrag$Swap$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrag$Swap$baseColor); + $author$project$DnDList$OperationsOnDrag$Swap$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrag$Swap$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Swap$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrag$Swap$dragColor = 'red'; -var $author$project$Config$OperationsOnDrag$Swap$dropColor = 'green'; -var $author$project$Config$OperationsOnDrag$Swap$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrag$Swap$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrag$Swap$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrag$Swap$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - var color = _v0.aV; - return _Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$Swap$Item, value, $author$project$Config$OperationsOnDrag$Swap$dropColor) : (_Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$Swap$Item, value, $author$project$Config$OperationsOnDrag$Swap$dragColor) : A2($author$project$Config$OperationsOnDrag$Swap$Item, value, color)); + var value = _v0.aC; + var color = _v0.a_; + return _Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$Swap$Item, value, $author$project$DnDList$OperationsOnDrag$Swap$dropColor) : (_Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$Swap$Item, value, $author$project$DnDList$OperationsOnDrag$Swap$dragColor) : A2($author$project$DnDList$OperationsOnDrag$Swap$Item, value, color)); }), items) : items; }); -var $author$project$Config$OperationsOnDrag$Swap$config = {cv: $author$project$Config$OperationsOnDrag$Swap$beforeUpdate, dg: 0, dk: 0, ds: 3}; -var $author$project$Config$OperationsOnDrag$Swap$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrag$Swap$config, $author$project$Config$OperationsOnDrag$Swap$MyMsg); -var $author$project$Config$OperationsOnDrag$Swap$initialModel = {aa: $author$project$Config$OperationsOnDrag$Swap$system.dj, au: $author$project$Config$OperationsOnDrag$Swap$data}; -var $author$project$Config$OperationsOnDrag$Unaltered$Item = F2( +var $author$project$DnDList$OperationsOnDrag$Swap$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$DnDList$OperationsOnDrag$Swap$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrag$Swap$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrag$Swap$beforeUpdate, $author$project$DnDList$OperationsOnDrag$Swap$config)); +var $author$project$DnDList$OperationsOnDrag$Swap$initialModel = {Z: $author$project$DnDList$OperationsOnDrag$Swap$system.b0, av: $author$project$DnDList$OperationsOnDrag$Swap$data}; +var $author$project$DnDList$OperationsOnDrag$Unaltered$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrag$Unaltered$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrag$Unaltered$data = A2( +var $author$project$DnDList$OperationsOnDrag$Unaltered$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrag$Unaltered$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrag$Unaltered$Item, + $author$project$DnDList$OperationsOnDrag$Unaltered$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrag$Unaltered$baseColor); + $author$project$DnDList$OperationsOnDrag$Unaltered$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrag$Unaltered$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Unaltered$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$Unaltered = 4; -var $author$project$Config$OperationsOnDrag$Unaltered$dragColor = 'red'; -var $author$project$Config$OperationsOnDrag$Unaltered$dropColor = 'green'; -var $author$project$Config$OperationsOnDrag$Unaltered$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrag$Unaltered$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrag$Unaltered$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrag$Unaltered$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - var color = _v0.aV; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrag$Unaltered$Item, value, $author$project$Config$OperationsOnDrag$Unaltered$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrag$Unaltered$Item, value, $author$project$Config$OperationsOnDrag$Unaltered$dropColor) : A2($author$project$Config$OperationsOnDrag$Unaltered$Item, value, color)); + var value = _v0.aC; + var color = _v0.a_; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrag$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrag$Unaltered$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrag$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrag$Unaltered$dropColor) : A2($author$project$DnDList$OperationsOnDrag$Unaltered$Item, value, color)); }), items) : items; }); -var $author$project$Config$OperationsOnDrag$Unaltered$config = {cv: $author$project$Config$OperationsOnDrag$Unaltered$beforeUpdate, dg: 0, dk: 0, ds: 4}; -var $author$project$Config$OperationsOnDrag$Unaltered$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrag$Unaltered$config, $author$project$Config$OperationsOnDrag$Unaltered$MyMsg); -var $author$project$Config$OperationsOnDrag$Unaltered$initialModel = {aa: $author$project$Config$OperationsOnDrag$Unaltered$system.dj, au: $author$project$Config$OperationsOnDrag$Unaltered$data}; -var $author$project$Config$OperationsOnDrag$Root$initialModel = { - Q: _List_fromArray( +var $author$project$DnDList$Unaltered = 4; +var $author$project$DnDList$OperationsOnDrag$Unaltered$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 4}); +var $author$project$DnDList$OperationsOnDrag$Unaltered$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrag$Unaltered$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrag$Unaltered$beforeUpdate, $author$project$DnDList$OperationsOnDrag$Unaltered$config)); +var $author$project$DnDList$OperationsOnDrag$Unaltered$initialModel = {Z: $author$project$DnDList$OperationsOnDrag$Unaltered$system.b0, av: $author$project$DnDList$OperationsOnDrag$Unaltered$data}; +var $author$project$DnDList$OperationsOnDrag$Parent$initialModel = { + at: _List_fromArray( [ - $author$project$Config$OperationsOnDrag$Root$InsertAfter($author$project$Config$OperationsOnDrag$InsertAfter$initialModel), - $author$project$Config$OperationsOnDrag$Root$InsertBefore($author$project$Config$OperationsOnDrag$InsertBefore$initialModel), - $author$project$Config$OperationsOnDrag$Root$Rotate($author$project$Config$OperationsOnDrag$Rotate$initialModel), - $author$project$Config$OperationsOnDrag$Root$Swap($author$project$Config$OperationsOnDrag$Swap$initialModel), - $author$project$Config$OperationsOnDrag$Root$Unaltered($author$project$Config$OperationsOnDrag$Unaltered$initialModel) + $author$project$DnDList$OperationsOnDrag$Parent$InsertAfter($author$project$DnDList$OperationsOnDrag$InsertAfter$initialModel), + $author$project$DnDList$OperationsOnDrag$Parent$InsertBefore($author$project$DnDList$OperationsOnDrag$InsertBefore$initialModel), + $author$project$DnDList$OperationsOnDrag$Parent$Rotate($author$project$DnDList$OperationsOnDrag$Rotate$initialModel), + $author$project$DnDList$OperationsOnDrag$Parent$Swap($author$project$DnDList$OperationsOnDrag$Swap$initialModel), + $author$project$DnDList$OperationsOnDrag$Parent$Unaltered($author$project$DnDList$OperationsOnDrag$Unaltered$initialModel) ]), - at: 0 + a7: 0 }; -var $author$project$Config$OperationsOnDrop$Root$InsertAfter = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$InsertAfter = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$InsertBefore = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$InsertBefore = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$Rotate = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$Rotate = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$Swap = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$Swap = function (a) { return {$: 3, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$Unaltered = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$Unaltered = function (a) { return {$: 4, a: a}; }; -var $author$project$Config$OperationsOnDrop$InsertAfter$Item = F2( +var $author$project$DnDList$OperationsOnDrop$InsertAfter$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrop$InsertAfter$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrop$InsertAfter$data = A2( +var $author$project$DnDList$OperationsOnDrop$InsertAfter$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrop$InsertAfter$Item, + $author$project$DnDList$OperationsOnDrop$InsertAfter$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrop$InsertAfter$baseColor); + $author$project$DnDList$OperationsOnDrop$InsertAfter$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrop$InsertAfter$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$InsertAfter$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrop$InsertAfter$affectedColor = 'purple'; -var $author$project$Config$OperationsOnDrop$InsertAfter$dragColor = 'red'; -var $author$project$Config$OperationsOnDrop$InsertAfter$dropColor = 'green'; -var $author$project$Config$OperationsOnDrop$InsertAfter$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrop$InsertAfter$affectedColor = 'purple'; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$affectedColor) : A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$baseColor))); + var value = _v0.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$affectedColor) : A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$baseColor))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$affectedColor) : A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$baseColor))); + var value = _v1.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$affectedColor) : A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$baseColor))); }), items) : items); }); -var $author$project$Config$OperationsOnDrop$InsertAfter$config = {cv: $author$project$Config$OperationsOnDrop$InsertAfter$beforeUpdate, dg: 1, dk: 0, ds: 0}; -var $author$project$Config$OperationsOnDrop$InsertAfter$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrop$InsertAfter$config, $author$project$Config$OperationsOnDrop$InsertAfter$MyMsg); -var $author$project$Config$OperationsOnDrop$InsertAfter$initialModel = {aa: $author$project$Config$OperationsOnDrop$InsertAfter$system.dj, au: $author$project$Config$OperationsOnDrop$InsertAfter$data}; -var $author$project$Config$OperationsOnDrop$InsertBefore$Item = F2( +var $author$project$DnDList$OperationsOnDrop$InsertAfter$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 0}); +var $author$project$DnDList$OperationsOnDrop$InsertAfter$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrop$InsertAfter$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrop$InsertAfter$beforeUpdate, $author$project$DnDList$OperationsOnDrop$InsertAfter$config)); +var $author$project$DnDList$OperationsOnDrop$InsertAfter$initialModel = {Z: $author$project$DnDList$OperationsOnDrop$InsertAfter$system.b0, av: $author$project$DnDList$OperationsOnDrop$InsertAfter$data}; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrop$InsertBefore$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrop$InsertBefore$data = A2( +var $author$project$DnDList$OperationsOnDrop$InsertBefore$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrop$InsertBefore$Item, + $author$project$DnDList$OperationsOnDrop$InsertBefore$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrop$InsertBefore$baseColor); + $author$project$DnDList$OperationsOnDrop$InsertBefore$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrop$InsertBefore$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$InsertBefore$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrop$InsertBefore$affectedColor = 'purple'; -var $author$project$Config$OperationsOnDrop$InsertBefore$dragColor = 'red'; -var $author$project$Config$OperationsOnDrop$InsertBefore$dropColor = 'green'; -var $author$project$Config$OperationsOnDrop$InsertBefore$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrop$InsertBefore$affectedColor = 'purple'; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$affectedColor) : A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$baseColor))); + var value = _v0.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$affectedColor) : A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$baseColor))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$affectedColor) : A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$baseColor))); + var value = _v1.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$affectedColor) : A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$baseColor))); }), items) : items); }); -var $author$project$Config$OperationsOnDrop$InsertBefore$config = {cv: $author$project$Config$OperationsOnDrop$InsertBefore$beforeUpdate, dg: 1, dk: 0, ds: 1}; -var $author$project$Config$OperationsOnDrop$InsertBefore$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrop$InsertBefore$config, $author$project$Config$OperationsOnDrop$InsertBefore$MyMsg); -var $author$project$Config$OperationsOnDrop$InsertBefore$initialModel = {aa: $author$project$Config$OperationsOnDrop$InsertBefore$system.dj, au: $author$project$Config$OperationsOnDrop$InsertBefore$data}; -var $author$project$Config$OperationsOnDrop$Rotate$Item = F2( +var $author$project$DnDList$OperationsOnDrop$InsertBefore$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 1}); +var $author$project$DnDList$OperationsOnDrop$InsertBefore$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrop$InsertBefore$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrop$InsertBefore$beforeUpdate, $author$project$DnDList$OperationsOnDrop$InsertBefore$config)); +var $author$project$DnDList$OperationsOnDrop$InsertBefore$initialModel = {Z: $author$project$DnDList$OperationsOnDrop$InsertBefore$system.b0, av: $author$project$DnDList$OperationsOnDrop$InsertBefore$data}; +var $author$project$DnDList$OperationsOnDrop$Rotate$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrop$Rotate$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrop$Rotate$data = A2( +var $author$project$DnDList$OperationsOnDrop$Rotate$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrop$Rotate$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrop$Rotate$Item, + $author$project$DnDList$OperationsOnDrop$Rotate$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrop$Rotate$baseColor); + $author$project$DnDList$OperationsOnDrop$Rotate$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrop$Rotate$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Rotate$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrop$Rotate$affectedColor = 'purple'; -var $author$project$Config$OperationsOnDrop$Rotate$dragColor = 'red'; -var $author$project$Config$OperationsOnDrop$Rotate$dropColor = 'green'; -var $author$project$Config$OperationsOnDrop$Rotate$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrop$Rotate$affectedColor = 'purple'; +var $author$project$DnDList$OperationsOnDrop$Rotate$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrop$Rotate$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrop$Rotate$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$affectedColor) : A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$baseColor))); + var value = _v0.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$dropColor) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$affectedColor) : A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$baseColor))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$affectedColor) : A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$baseColor))); + var value = _v1.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$dropColor) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$affectedColor) : A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$baseColor))); }), items) : items); }); -var $author$project$Config$OperationsOnDrop$Rotate$config = {cv: $author$project$Config$OperationsOnDrop$Rotate$beforeUpdate, dg: 1, dk: 0, ds: 2}; -var $author$project$Config$OperationsOnDrop$Rotate$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrop$Rotate$config, $author$project$Config$OperationsOnDrop$Rotate$MyMsg); -var $author$project$Config$OperationsOnDrop$Rotate$initialModel = {aa: $author$project$Config$OperationsOnDrop$Rotate$system.dj, au: $author$project$Config$OperationsOnDrop$Rotate$data}; -var $author$project$Config$OperationsOnDrop$Swap$Item = F2( +var $author$project$DnDList$OperationsOnDrop$Rotate$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 2}); +var $author$project$DnDList$OperationsOnDrop$Rotate$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrop$Rotate$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrop$Rotate$beforeUpdate, $author$project$DnDList$OperationsOnDrop$Rotate$config)); +var $author$project$DnDList$OperationsOnDrop$Rotate$initialModel = {Z: $author$project$DnDList$OperationsOnDrop$Rotate$system.b0, av: $author$project$DnDList$OperationsOnDrop$Rotate$data}; +var $author$project$DnDList$OperationsOnDrop$Swap$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrop$Swap$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrop$Swap$data = A2( +var $author$project$DnDList$OperationsOnDrop$Swap$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrop$Swap$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrop$Swap$Item, + $author$project$DnDList$OperationsOnDrop$Swap$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrop$Swap$baseColor); + $author$project$DnDList$OperationsOnDrop$Swap$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrop$Swap$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Swap$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrop$Swap$dragColor = 'red'; -var $author$project$Config$OperationsOnDrop$Swap$dropColor = 'green'; -var $author$project$Config$OperationsOnDrop$Swap$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrop$Swap$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrop$Swap$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrop$Swap$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - return _Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$Swap$Item, value, $author$project$Config$OperationsOnDrop$Swap$dropColor) : (_Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$Swap$Item, value, $author$project$Config$OperationsOnDrop$Swap$dragColor) : A2($author$project$Config$OperationsOnDrop$Swap$Item, value, $author$project$Config$OperationsOnDrop$Swap$baseColor)); + var value = _v0.aC; + return _Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$Swap$Item, value, $author$project$DnDList$OperationsOnDrop$Swap$dropColor) : (_Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$Swap$Item, value, $author$project$DnDList$OperationsOnDrop$Swap$dragColor) : A2($author$project$DnDList$OperationsOnDrop$Swap$Item, value, $author$project$DnDList$OperationsOnDrop$Swap$baseColor)); }), items) : items; }); -var $author$project$Config$OperationsOnDrop$Swap$config = {cv: $author$project$Config$OperationsOnDrop$Swap$beforeUpdate, dg: 1, dk: 0, ds: 3}; -var $author$project$Config$OperationsOnDrop$Swap$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrop$Swap$config, $author$project$Config$OperationsOnDrop$Swap$MyMsg); -var $author$project$Config$OperationsOnDrop$Swap$initialModel = {aa: $author$project$Config$OperationsOnDrop$Swap$system.dj, au: $author$project$Config$OperationsOnDrop$Swap$data}; -var $author$project$Config$OperationsOnDrop$Unaltered$Item = F2( +var $author$project$DnDList$OperationsOnDrop$Swap$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 3}); +var $author$project$DnDList$OperationsOnDrop$Swap$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrop$Swap$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrop$Swap$beforeUpdate, $author$project$DnDList$OperationsOnDrop$Swap$config)); +var $author$project$DnDList$OperationsOnDrop$Swap$initialModel = {Z: $author$project$DnDList$OperationsOnDrop$Swap$system.b0, av: $author$project$DnDList$OperationsOnDrop$Swap$data}; +var $author$project$DnDList$OperationsOnDrop$Unaltered$Item = F2( function (value, color) { - return {aV: color, aB: value}; + return {a_: color, aC: value}; }); -var $author$project$Config$OperationsOnDrop$Unaltered$baseColor = 'dimgray'; -var $author$project$Config$OperationsOnDrop$Unaltered$data = A2( +var $author$project$DnDList$OperationsOnDrop$Unaltered$baseColor = 'dimgray'; +var $author$project$DnDList$OperationsOnDrop$Unaltered$data = A2( $elm$core$List$map, function (i) { return A2( - $author$project$Config$OperationsOnDrop$Unaltered$Item, + $author$project$DnDList$OperationsOnDrop$Unaltered$Item, $elm$core$String$fromInt(i), - $author$project$Config$OperationsOnDrop$Unaltered$baseColor); + $author$project$DnDList$OperationsOnDrop$Unaltered$baseColor); }, A2($elm$core$List$range, 1, 9)); -var $author$project$Config$OperationsOnDrop$Unaltered$MyMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Unaltered$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrop$Unaltered$dragColor = 'red'; -var $author$project$Config$OperationsOnDrop$Unaltered$dropColor = 'green'; -var $author$project$Config$OperationsOnDrop$Unaltered$beforeUpdate = F3( +var $author$project$DnDList$OperationsOnDrop$Unaltered$dragColor = 'red'; +var $author$project$DnDList$OperationsOnDrop$Unaltered$dropColor = 'green'; +var $author$project$DnDList$OperationsOnDrop$Unaltered$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$indexedMap, F2( function (i, _v0) { - var value = _v0.aB; - return _Utils_eq(i, dragIndex) ? A2($author$project$Config$OperationsOnDrop$Unaltered$Item, value, $author$project$Config$OperationsOnDrop$Unaltered$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$Config$OperationsOnDrop$Unaltered$Item, value, $author$project$Config$OperationsOnDrop$Unaltered$dropColor) : A2($author$project$Config$OperationsOnDrop$Unaltered$Item, value, $author$project$Config$OperationsOnDrop$Unaltered$baseColor)); + var value = _v0.aC; + return _Utils_eq(i, dragIndex) ? A2($author$project$DnDList$OperationsOnDrop$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrop$Unaltered$dragColor) : (_Utils_eq(i, dropIndex) ? A2($author$project$DnDList$OperationsOnDrop$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrop$Unaltered$dropColor) : A2($author$project$DnDList$OperationsOnDrop$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrop$Unaltered$baseColor)); }), items) : items; }); -var $author$project$Config$OperationsOnDrop$Unaltered$config = {cv: $author$project$Config$OperationsOnDrop$Unaltered$beforeUpdate, dg: 1, dk: 0, ds: 4}; -var $author$project$Config$OperationsOnDrop$Unaltered$system = A2($author$project$DnDList$create, $author$project$Config$OperationsOnDrop$Unaltered$config, $author$project$Config$OperationsOnDrop$Unaltered$MyMsg); -var $author$project$Config$OperationsOnDrop$Unaltered$initialModel = {aa: $author$project$Config$OperationsOnDrop$Unaltered$system.dj, au: $author$project$Config$OperationsOnDrop$Unaltered$data}; -var $author$project$Config$OperationsOnDrop$Root$initialModel = { - Q: _List_fromArray( +var $author$project$DnDList$OperationsOnDrop$Unaltered$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 4}); +var $author$project$DnDList$OperationsOnDrop$Unaltered$system = A2( + $author$project$DnDList$create, + $author$project$DnDList$OperationsOnDrop$Unaltered$DnDMsg, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$DnDList$OperationsOnDrop$Unaltered$beforeUpdate, $author$project$DnDList$OperationsOnDrop$Unaltered$config)); +var $author$project$DnDList$OperationsOnDrop$Unaltered$initialModel = {Z: $author$project$DnDList$OperationsOnDrop$Unaltered$system.b0, av: $author$project$DnDList$OperationsOnDrop$Unaltered$data}; +var $author$project$DnDList$OperationsOnDrop$Parent$initialModel = { + at: _List_fromArray( [ - $author$project$Config$OperationsOnDrop$Root$InsertAfter($author$project$Config$OperationsOnDrop$InsertAfter$initialModel), - $author$project$Config$OperationsOnDrop$Root$InsertBefore($author$project$Config$OperationsOnDrop$InsertBefore$initialModel), - $author$project$Config$OperationsOnDrop$Root$Rotate($author$project$Config$OperationsOnDrop$Rotate$initialModel), - $author$project$Config$OperationsOnDrop$Root$Swap($author$project$Config$OperationsOnDrop$Swap$initialModel), - $author$project$Config$OperationsOnDrop$Root$Unaltered($author$project$Config$OperationsOnDrop$Unaltered$initialModel) + $author$project$DnDList$OperationsOnDrop$Parent$InsertAfter($author$project$DnDList$OperationsOnDrop$InsertAfter$initialModel), + $author$project$DnDList$OperationsOnDrop$Parent$InsertBefore($author$project$DnDList$OperationsOnDrop$InsertBefore$initialModel), + $author$project$DnDList$OperationsOnDrop$Parent$Rotate($author$project$DnDList$OperationsOnDrop$Rotate$initialModel), + $author$project$DnDList$OperationsOnDrop$Parent$Swap($author$project$DnDList$OperationsOnDrop$Swap$initialModel), + $author$project$DnDList$OperationsOnDrop$Parent$Unaltered($author$project$DnDList$OperationsOnDrop$Unaltered$initialModel) ]), - at: 0 + a7: 0 }; -var $author$project$Config$Root$toExample = function (slug) { +var $author$project$DnDList$Parent$toExample = function (slug) { switch (slug) { case 'movement': - return $author$project$Config$Root$Movement($author$project$Config$Movement$Root$initialModel); + return $author$project$DnDList$Parent$Movement($author$project$DnDList$Movement$Parent$initialModel); case 'operations-drag': - return $author$project$Config$Root$OperationsOnDrag($author$project$Config$OperationsOnDrag$Root$initialModel); + return $author$project$DnDList$Parent$OperationsOnDrag($author$project$DnDList$OperationsOnDrag$Parent$initialModel); case 'operations-drop': - return $author$project$Config$Root$OperationsOnDrop($author$project$Config$OperationsOnDrop$Root$initialModel); + return $author$project$DnDList$Parent$OperationsOnDrop($author$project$DnDList$OperationsOnDrop$Parent$initialModel); + case 'hook-commands': + return $author$project$DnDList$Parent$HookCommands($author$project$DnDList$HookCommands$Parent$initialModel); default: - return $author$project$Config$Root$Movement($author$project$Config$Movement$Root$initialModel); + return $author$project$DnDList$Parent$Movement($author$project$DnDList$Movement$Parent$initialModel); } }; -var $author$project$Config$Root$init = function (slug) { +var $author$project$DnDList$Parent$init = function (slug) { return _Utils_Tuple2( - $author$project$Config$Root$toExample(slug), + $author$project$DnDList$Parent$toExample(slug), $elm$core$Platform$Cmd$none); }; -var $author$project$ConfigGroups$Root$OperationsOnDrag = function (a) { +var $author$project$DnDListGroups$Parent$HookCommands = function (a) { + return {$: 2, a: a}; +}; +var $author$project$DnDListGroups$Parent$OperationsOnDrag = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$Root$OperationsOnDrop = function (a) { +var $author$project$DnDListGroups$Parent$OperationsOnDrop = function (a) { return {$: 1, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfter = function (a) { +var $author$project$DnDListGroups$HookCommands$Parent$DetectDrop = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBefore = function (a) { +var $author$project$DnDListGroups$HookCommands$Parent$DetectReorder = function (a) { return {$: 1, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$Rotate = function (a) { - return {$: 2, a: a}; -}; -var $author$project$ConfigGroups$OperationsOnDrag$Root$Swap = function (a) { - return {$: 3, a: a}; -}; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item = F3( +var $author$project$DnDListGroups$HookCommands$DetectDrop$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$transparent = 'transparent'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$preparedData = _List_fromArray( +var $author$project$DnDListGroups$HookCommands$DetectDrop$letterColor = '#1e9daa'; +var $author$project$DnDListGroups$HookCommands$DetectDrop$numberColor = '#aa1e9d'; +var $author$project$DnDListGroups$HookCommands$DetectDrop$transparent = 'transparent'; +var $author$project$DnDListGroups$HookCommands$DetectDrop$preparedData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 1, '', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$transparent), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 2, '', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$transparent), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 3, '', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$transparent), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor) + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 1, 'F', $author$project$DnDListGroups$HookCommands$DetectDrop$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 1, '3', $author$project$DnDListGroups$HookCommands$DetectDrop$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 1, '1', $author$project$DnDListGroups$HookCommands$DetectDrop$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 1, 'L', $author$project$DnDListGroups$HookCommands$DetectDrop$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 1, 'A', $author$project$DnDListGroups$HookCommands$DetectDrop$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 1, '', $author$project$DnDListGroups$HookCommands$DetectDrop$transparent), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 2, '4', $author$project$DnDListGroups$HookCommands$DetectDrop$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 2, 'S', $author$project$DnDListGroups$HookCommands$DetectDrop$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 2, '8', $author$project$DnDListGroups$HookCommands$DetectDrop$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 2, 'M', $author$project$DnDListGroups$HookCommands$DetectDrop$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectDrop$Item, 2, '', $author$project$DnDListGroups$HookCommands$DetectDrop$transparent) ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$MyMsg = function (a) { +var $author$project$DnDListGroups$HookCommands$DetectDrop$DetectDrop = F3( + function (a, b, c) { + return {$: 1, a: a, b: b, c: c}; + }); +var $author$project$DnDListGroups$HookCommands$DetectDrop$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$Groups$InsertAfter = 0; +var $author$project$DnDList$Groups$InsertBefore = 1; var $author$project$DnDList$Groups$OnDrag = 0; -var $author$project$DnDList$Groups$Unaltered = 4; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$affectedColor = 'purple'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$beforeUpdate = F3( - function (dragIndex, dropIndex, items) { - return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( - $elm$core$List$indexedMap, - F2( - function (i, item) { - return _Utils_eq(i, dragIndex) ? _Utils_update( - item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( - item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( - item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$affectedColor}) : item)); - }), - items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( - $elm$core$List$indexedMap, - F2( - function (i, item) { - return _Utils_eq(i, dragIndex) ? _Utils_update( - item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( - item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( - item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$affectedColor}) : item)); - }), - items) : items); - }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$comparator = F2( +var $author$project$DnDList$Groups$OnDrop = 1; +var $author$project$DnDList$Groups$Rotate = 2; +var $author$project$DnDListGroups$HookCommands$DetectDrop$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$setter = F2( - function (item1, item2) { - return _Utils_update( - item2, - {t: item1.t}); +var $author$project$DnDList$Groups$Config = F2( + function (a, b) { + return {$: 0, a: a, b: b}; }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$config = { - cv: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$comparator, dg: 0, ds: 0, dC: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$setter}, - dg: 0, - ds: 4 -}; -var $author$project$DnDList$Groups$Model = $elm$core$Basics$identity; -var $author$project$DnDList$Groups$GotDragElement = function (a) { - return {$: 6, a: a}; +var $author$project$DnDList$Groups$defaultOptions = { + aJ: $elm$core$Maybe$Nothing, + a4: $elm$core$Maybe$Nothing, + a5: _List_fromArray( + ['width', 'height', 'position']), + aL: F3( + function (_v0, _v1, list) { + return list; + }) }; -var $author$project$DnDList$Groups$dragElementCommands = F2( - function (stepMsg, state) { - var _v0 = state.P; - if (_v0.$ === 1) { - return A2( - $elm$core$Task$attempt, - A2($elm$core$Basics$composeL, stepMsg, $author$project$DnDList$Groups$GotDragElement), - $elm$browser$Browser$Dom$getElement(state.aq)); - } else { - return $elm$core$Platform$Cmd$none; - } - }); -var $author$project$DnDList$Groups$GotDropElement = function (a) { - return {$: 7, a: a}; +var $author$project$DnDList$Groups$config = function (settings) { + return A2($author$project$DnDList$Groups$Config, settings, $author$project$DnDList$Groups$defaultOptions); }; -var $author$project$DnDList$Groups$dropElementCommands = F2( - function (stepMsg, state) { - return (!state.n) ? A2( - $elm$core$Task$attempt, - A2($elm$core$Basics$composeL, stepMsg, $author$project$DnDList$Groups$GotDropElement), - $elm$browser$Browser$Dom$getElement(state.ac)) : $elm$core$Platform$Cmd$none; +var $author$project$DnDListGroups$HookCommands$DetectDrop$setter = F2( + function (item1, item2) { + return _Utils_update( + item2, + {x: item1.x}); }); -var $author$project$DnDList$Groups$commands = F2( - function (stepMsg, _v0) { - var model = _v0; - if (model.$ === 1) { - return $elm$core$Platform$Cmd$none; - } else { - var state = model.a; - return $elm$core$Platform$Cmd$batch( - _List_fromArray( - [ - A2($author$project$DnDList$Groups$dragElementCommands, stepMsg, state), - A2($author$project$DnDList$Groups$dropElementCommands, stepMsg, state) - ])); - } +var $author$project$DnDListGroups$HookCommands$DetectDrop$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$HookCommands$DetectDrop$comparator, bp: 0, a9: 1, cj: $author$project$DnDListGroups$HookCommands$DetectDrop$setter}, + bp: 1, + a9: 2 }); -var $author$project$DnDList$Groups$DragStart = F3( +var $author$project$DnDList$Groups$Model = $elm$core$Basics$identity; +var $author$project$DnDList$Groups$DownDragItem = F3( function (a, b, c) { return {$: 0, a: a, b: b, c: c}; }); var $author$project$DnDList$Groups$dragEvents = F3( - function (stepMsg, dragIndex, dragElementId) { + function (toMsg, dragIndex, dragElementId) { return _List_fromArray( [ A2( @@ -7193,72 +7524,70 @@ var $author$project$DnDList$Groups$dragEvents = F3( A2( $elm$json$Json$Decode$map, A2( - $elm$core$Basics$composeL, - stepMsg, - A2($author$project$DnDList$Groups$DragStart, dragIndex, dragElementId)), - $author$project$Internal$Common$Utils$decodeCoordinatesWithButtonCheck))) + $elm$core$Basics$composeR, + A2($author$project$DnDList$Groups$DownDragItem, dragIndex, dragElementId), + toMsg), + $author$project$Internal$Decoders$decodeCoordinatesWithButtonCheck))) ]); }); -var $author$project$DnDList$Groups$DragEnter = function (a) { - return {$: 3, a: a}; +var $author$project$DnDList$Groups$EnterDropItem = {$: 2}; +var $author$project$DnDList$Groups$InBetweenMsg = function (a) { + return {$: 1, a: a}; }; -var $author$project$DnDList$Groups$DragLeave = {$: 4}; -var $author$project$DnDList$Groups$DragOver = F2( +var $author$project$DnDList$Groups$LeaveDropItem = {$: 3}; +var $author$project$DnDList$Groups$OverDropItem = F2( function (a, b) { - return {$: 2, a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $author$project$DnDList$Groups$dropEvents = F3( - function (stepMsg, dropIndex, dropElementId) { + function (toMsg, dropIndex, dropElementId) { return _List_fromArray( [ $elm$html$Html$Events$onMouseOver( - stepMsg( - A2($author$project$DnDList$Groups$DragOver, dropIndex, dropElementId))), + toMsg( + $author$project$DnDList$Groups$InBetweenMsg( + A2($author$project$DnDList$Groups$OverDropItem, dropIndex, dropElementId)))), $elm$html$Html$Events$onMouseEnter( - stepMsg( - $author$project$DnDList$Groups$DragEnter(dropIndex))), + toMsg( + $author$project$DnDList$Groups$InBetweenMsg($author$project$DnDList$Groups$EnterDropItem))), $elm$html$Html$Events$onMouseLeave( - stepMsg($author$project$DnDList$Groups$DragLeave)) + toMsg( + $author$project$DnDList$Groups$InBetweenMsg($author$project$DnDList$Groups$LeaveDropItem))) ]); }); -var $author$project$DnDList$Groups$ghostStyles = function (_v0) { - var model = _v0; - if (model.$ === 1) { - return _List_Nil; - } else { - var state = model.a; - var _v2 = state.P; - if (!_v2.$) { - var element = _v2.a.cW; - return _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2( - $elm$html$Html$Attributes$style, - 'transform', - A2( - $author$project$Internal$Common$Utils$translate, - $elm$core$Basics$round((state.w.V - state.H.V) + element.V), - $elm$core$Basics$round((state.w.W - state.H.W) + element.W))), - A2( - $elm$html$Html$Attributes$style, - 'height', - $author$project$Internal$Common$Utils$px( - $elm$core$Basics$round(element.c2))), - A2( - $elm$html$Html$Attributes$style, - 'width', - $author$project$Internal$Common$Utils$px( - $elm$core$Basics$round(element.d4))), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'none') - ]); +var $author$project$DnDList$Groups$transformDeclaration = F2( + function (_v0, _v1) { + var x = _v0.aF; + var y = _v0.aG; + var element = _v1.c5; + return A2( + $elm$html$Html$Attributes$style, + 'transform', + A2( + $author$project$Internal$Ghost$translate, + $elm$core$Basics$round(x + element.aF), + $elm$core$Basics$round(y + element.aG))); + }); +var $author$project$DnDList$Groups$ghostStyles = F2( + function (_v0, _v1) { + var options = _v0.b; + var model = _v1; + if (!model.$) { + var state = model.a; + var _v3 = state.Q; + if (!_v3.$) { + var dragElement = _v3.a; + return A2( + $elm$core$List$cons, + A2($author$project$DnDList$Groups$transformDeclaration, state.bd, dragElement), + A2($author$project$Internal$Ghost$baseDeclarations, options.a5, dragElement)); + } else { + return _List_Nil; + } } else { return _List_Nil; } - } -}; + }); var $author$project$DnDList$Groups$info = function (_v0) { var model = _v0; return A2( @@ -7268,38 +7597,42 @@ var $author$project$DnDList$Groups$info = function (_v0) { $elm$core$Maybe$map2, F2( function (dragElement, dropElement) { - return {w: state.w, P: dragElement, aq: state.aq, a9: state.a9, ab: dropElement, ac: state.ac, cV: state.cV, H: state.H}; + return {O: state.O, Q: dragElement, aq: state.aq, c: state.c, _: dropElement, ar: state.ar, h: state.h, ah: state.ah}; }), - state.P, - state.ab); + state.Q, + state._); }, model); }; -var $author$project$DnDList$Groups$Drag = function (a) { - return {$: 1, a: a}; +var $author$project$DnDList$Groups$MoveDocument = function (a) { + return {$: 0, a: a}; }; -var $author$project$DnDList$Groups$DragEnd = {$: 5}; +var $author$project$DnDList$Groups$Tick = {$: 6}; +var $author$project$DnDList$Groups$UpDocument = {$: 2}; var $author$project$DnDList$Groups$subscriptions = F2( - function (stepMsg, _v0) { + function (toMsg, _v0) { var model = _v0; - if (model.$ === 1) { - return $elm$core$Platform$Sub$none; - } else { - return $elm$core$Platform$Sub$batch( - _List_fromArray( - [ - $elm$browser$Browser$Events$onMouseMove( + return (!_Utils_eq(model, $elm$core$Maybe$Nothing)) ? $elm$core$Platform$Sub$batch( + _List_fromArray( + [ + $elm$browser$Browser$Events$onMouseMove( + A2( + $elm$json$Json$Decode$map, A2( - $elm$json$Json$Decode$map, - A2($elm$core$Basics$composeL, stepMsg, $author$project$DnDList$Groups$Drag), - $author$project$Internal$Common$Utils$decodeCoordinates)), - $elm$browser$Browser$Events$onMouseUp( - $elm$json$Json$Decode$succeed( - stepMsg($author$project$DnDList$Groups$DragEnd))) - ])); - } + $elm$core$Basics$composeR, + $author$project$DnDList$Groups$MoveDocument, + A2($elm$core$Basics$composeR, $author$project$DnDList$Groups$InBetweenMsg, toMsg)), + $author$project$Internal$Decoders$decodeCoordinates)), + $elm$browser$Browser$Events$onMouseUp( + $elm$json$Json$Decode$succeed( + toMsg($author$project$DnDList$Groups$UpDocument))), + $elm$browser$Browser$Events$onAnimationFrameDelta( + A2( + $elm$core$Basics$composeR, + $elm$core$Basics$always($author$project$DnDList$Groups$Tick), + A2($elm$core$Basics$composeR, $author$project$DnDList$Groups$InBetweenMsg, toMsg))) + ])) : $elm$core$Platform$Sub$none; }); -var $author$project$DnDList$Groups$OnDrop = 1; var $author$project$Internal$Groups$drags = F2( function (dragIndex, list) { return A2( @@ -7329,6 +7662,27 @@ var $author$project$Internal$Groups$equalGroups = F4( A2($author$project$Internal$Groups$drags, dragIndex, list), A2($author$project$Internal$Groups$drops, dropIndex, list))); }); +var $author$project$DnDList$Groups$groupUpdate = F4( + function (operation, dragIndex, dropIndex, list) { + switch (operation) { + case 0: + return A3($author$project$Internal$Operations$insertAfter, dragIndex, dropIndex, list); + case 1: + return A3($author$project$Internal$Operations$insertBefore, dragIndex, dropIndex, list); + case 2: + return A3($author$project$Internal$Operations$rotate, dragIndex, dropIndex, list); + case 3: + return A3($author$project$Internal$Operations$swap, dragIndex, dropIndex, list); + default: + return list; + } + }); +var $author$project$DnDList$Groups$GotDragItem = function (a) { + return {$: 4, a: a}; +}; +var $author$project$DnDList$Groups$GotDropItem = function (a) { + return {$: 5, a: a}; +}; var $author$project$Internal$Groups$allGroupUpdate = F4( function (fn, i, j, l) { var middle = A2( @@ -7354,7 +7708,7 @@ var $elm$core$List$filter = F2( _List_Nil, list); }); -var $author$project$Internal$Groups$sublistByFirstItem = F2( +var $author$project$Internal$Groups$groupByFirstItem = F2( function (comparator, list) { if (!list.b) { return _List_Nil; @@ -7380,7 +7734,7 @@ var $author$project$Internal$Groups$bubbleGroupRecursive = F3( } else { var x = list.a; var xs = list.b; - var sublist = A2($author$project$Internal$Groups$sublistByFirstItem, comparator, list); + var sublist = A2($author$project$Internal$Groups$groupByFirstItem, comparator, list); return (!_Utils_eq(sublist, _List_Nil)) ? _Utils_ap( $elm$core$List$reverse( A2($elm$core$List$drop, 1, sublist)), @@ -7425,11 +7779,6 @@ var $author$project$Internal$Groups$bubbleGroupRecursive = F3( } } }); -var $elm$core$Basics$composeR = F3( - function (f, g, x) { - return g( - f(x)); - }); var $author$project$Internal$Groups$dragAndDropGroupUpdate = F4( function (setter, dragIndex, dropIndex, list) { var dropItem = A2($author$project$Internal$Groups$drops, dropIndex, list); @@ -7477,19 +7826,19 @@ var $author$project$DnDList$Groups$listUpdate = F6( switch (operation) { case 0: return A3( - $author$project$Internal$Common$Operations$insertAfter, + $author$project$Internal$Operations$insertAfter, dragIndex, dropIndex, A4($author$project$Internal$Groups$dragGroupUpdate, setter, dragIndex, dropIndex, list)); case 1: return A3( - $author$project$Internal$Common$Operations$insertBefore, + $author$project$Internal$Operations$insertBefore, dragIndex, dropIndex, A4($author$project$Internal$Groups$dragGroupUpdate, setter, dragIndex, dropIndex, list)); case 2: return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A3( - $author$project$Internal$Common$Operations$rotate, + $author$project$Internal$Operations$rotate, dragIndex, dropIndex, A4( @@ -7504,7 +7853,7 @@ var $author$project$DnDList$Groups$listUpdate = F6( dragIndex, dropIndex, list)) : ((_Utils_cmp(dropIndex, dragIndex) < 0) ? A3( - $author$project$Internal$Common$Operations$rotate, + $author$project$Internal$Operations$rotate, dragIndex, dropIndex, A4( @@ -7515,7 +7864,7 @@ var $author$project$DnDList$Groups$listUpdate = F6( list)) : list); case 3: return A3( - $author$project$Internal$Common$Operations$swap, + $author$project$Internal$Operations$swap, dragIndex, dropIndex, A4($author$project$Internal$Groups$dragAndDropGroupUpdate, setter, dragIndex, dropIndex, list)); @@ -7531,244 +7880,527 @@ var $author$project$DnDList$Groups$stateUpdate = F3( return _Utils_update( state, { - n: 0, - a9: (_Utils_cmp(dropIndex, state.a9) < 0) ? (dropIndex + 1) : dropIndex + c: (_Utils_cmp(dropIndex, state.c) < 0) ? (dropIndex + 1) : dropIndex, + v: 0 }); case 1: return _Utils_update( state, { - n: 0, - a9: (_Utils_cmp(state.a9, dropIndex) < 0) ? (dropIndex - 1) : dropIndex + c: (_Utils_cmp(state.c, dropIndex) < 0) ? (dropIndex - 1) : dropIndex, + v: 0 }); case 2: return _Utils_update( state, - {n: 0, a9: dropIndex}); + {c: dropIndex, v: 0}); case 3: return _Utils_update( state, - {n: 0, a9: dropIndex}); + {c: dropIndex, v: 0}); default: return _Utils_update( state, - {n: 0}); + {v: 0}); } }); -var $author$project$DnDList$Groups$sublistUpdate = F4( - function (operation, dragIndex, dropIndex, list) { - switch (operation) { +var $author$project$DnDList$Groups$inBetweenUpdate = F6( + function (settings, options, toMsg, list, msg, state) { + switch (msg.$) { case 0: - return A3($author$project$Internal$Common$Operations$insertAfter, dragIndex, dropIndex, list); + var coordinates = msg.a; + return _Utils_Tuple3( + list, + _Utils_update( + state, + {O: coordinates, v: state.v + 1}), + _Utils_eq(state.Q, $elm$core$Maybe$Nothing) ? A2( + $elm$core$Platform$Cmd$map, + A2($elm$core$Basics$composeR, $author$project$DnDList$Groups$InBetweenMsg, toMsg), + A2( + $elm$core$Task$attempt, + $author$project$DnDList$Groups$GotDragItem, + $elm$browser$Browser$Dom$getElement(state.aq))) : $elm$core$Platform$Cmd$none); case 1: - return A3($author$project$Internal$Common$Operations$insertBefore, dragIndex, dropIndex, list); + var dropIndex = msg.a; + var dropElementId = msg.b; + return _Utils_Tuple3( + list, + _Utils_update( + state, + {ar: dropElementId, h: dropIndex}), + A2( + $elm$core$Platform$Cmd$map, + A2($elm$core$Basics$composeR, $author$project$DnDList$Groups$InBetweenMsg, toMsg), + A2( + $elm$core$Task$attempt, + $author$project$DnDList$Groups$GotDropItem, + $elm$browser$Browser$Dom$getElement(dropElementId)))); case 2: - return A3($author$project$Internal$Common$Operations$rotate, dragIndex, dropIndex, list); + if ((state.v > 1) && (!_Utils_eq(state.c, state.h))) { + var equalGroups = A4($author$project$Internal$Groups$equalGroups, settings.r.a$, state.c, state.h, list); + if ((!settings.bp) && equalGroups) { + var newList = A4( + $author$project$DnDList$Groups$groupUpdate, + settings.a9, + state.c, + state.h, + A3(options.aL, state.c, state.h, list)); + return _Utils_Tuple3( + newList, + A3($author$project$DnDList$Groups$stateUpdate, settings.a9, state.h, state), + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(newList)); + }, + options.a4))); + } else { + if ((!settings.r.bp) && (!equalGroups)) { + var newList = A6( + $author$project$DnDList$Groups$listUpdate, + settings.r.a9, + settings.r.a$, + settings.r.cj, + state.c, + state.h, + A3(options.aL, state.c, state.h, list)); + return _Utils_Tuple3( + newList, + A3($author$project$DnDList$Groups$stateUpdate, settings.r.a9, state.h, state), + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(newList)); + }, + options.a4))); + } else { + return _Utils_Tuple3( + list, + _Utils_update( + state, + {v: 0}), + $elm$core$Platform$Cmd$none); + } + } + } else { + return _Utils_Tuple3(list, state, $elm$core$Platform$Cmd$none); + } case 3: - return A3($author$project$Internal$Common$Operations$swap, dragIndex, dropIndex, list); + return _Utils_Tuple3( + list, + _Utils_update( + state, + {h: state.c}), + $elm$core$Platform$Cmd$none); + case 4: + if (msg.a.$ === 1) { + return _Utils_Tuple3(list, state, $elm$core$Platform$Cmd$none); + } else { + var dragElement = msg.a.a; + return _Utils_Tuple3( + list, + _Utils_update( + state, + { + Q: $elm$core$Maybe$Just(dragElement), + _: $elm$core$Maybe$Just(dragElement) + }), + $elm$core$Platform$Cmd$none); + } + case 5: + if (msg.a.$ === 1) { + return _Utils_Tuple3(list, state, $elm$core$Platform$Cmd$none); + } else { + var dropElement = msg.a.a; + return _Utils_Tuple3( + list, + _Utils_update( + state, + { + _: $elm$core$Maybe$Just(dropElement) + }), + $elm$core$Platform$Cmd$none); + } default: - return list; + return _Utils_Tuple3( + list, + _Utils_update( + state, + { + bd: A2($author$project$Internal$Types$Coordinates, state.O.aF - state.ah.aF, state.O.aG - state.ah.aG) + }), + $elm$core$Platform$Cmd$none); } }); -var $author$project$DnDList$Groups$update = F4( - function (_v0, msg, _v1, list) { - var beforeUpdate = _v0.cv; - var listen = _v0.dg; - var operation = _v0.ds; - var groups = _v0.c1; +var $author$project$DnDList$Groups$update = F5( + function (_v0, toMsg, list, msg, _v1) { + var settings = _v0.a; + var options = _v0.b; var model = _v1; switch (msg.$) { case 0: var dragIndex = msg.a; var dragElementId = msg.b; - var xy = msg.c; - return _Utils_Tuple2( + var coordinates = msg.c; + return _Utils_Tuple3( + list, $elm$core$Maybe$Just( - {w: xy, n: 0, P: $elm$core$Maybe$Nothing, aq: dragElementId, a9: dragIndex, ab: $elm$core$Maybe$Nothing, ac: dragElementId, cV: dragIndex, H: xy}), - list); + { + O: coordinates, + Q: $elm$core$Maybe$Nothing, + aq: dragElementId, + c: dragIndex, + _: $elm$core$Maybe$Nothing, + ar: dragElementId, + h: dragIndex, + v: 0, + ah: coordinates, + bd: A2($author$project$Internal$Types$Coordinates, 0, 0) + }), + $elm$core$Platform$Cmd$none); case 1: - var xy = msg.a; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {w: xy, n: state.n + 1}); - }, - model), - list); - case 2: - var dropIndex = msg.a; - var dropElementId = msg.b; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {ac: dropElementId, cV: dropIndex}); - }, - model), - list); - case 3: - var dropIndex = msg.a; + var inBetweenMsg = msg.a; if (!model.$) { var state = model.a; - if ((state.n > 1) && (!_Utils_eq(state.a9, dropIndex))) { - var equalGroups = A4($author$project$Internal$Groups$equalGroups, groups.cN, state.a9, dropIndex, list); - return ((!listen) && equalGroups) ? _Utils_Tuple2( - $elm$core$Maybe$Just( - A3($author$project$DnDList$Groups$stateUpdate, operation, dropIndex, state)), - A4( - $author$project$DnDList$Groups$sublistUpdate, - operation, - state.a9, - dropIndex, - A3(beforeUpdate, state.a9, dropIndex, list))) : (((!groups.dg) && (!equalGroups)) ? _Utils_Tuple2( - $elm$core$Maybe$Just( - A3($author$project$DnDList$Groups$stateUpdate, groups.ds, dropIndex, state)), - A6( - $author$project$DnDList$Groups$listUpdate, - groups.ds, - groups.cN, - groups.dC, - state.a9, - dropIndex, - A3(beforeUpdate, state.a9, dropIndex, list))) : _Utils_Tuple2( - $elm$core$Maybe$Just( - _Utils_update( - state, - {n: 0})), - list)); - } else { - return _Utils_Tuple2(model, list); - } + var _v4 = A6($author$project$DnDList$Groups$inBetweenUpdate, settings, options, toMsg, list, inBetweenMsg, state); + var newList = _v4.a; + var newState = _v4.b; + var newCmd = _v4.c; + return _Utils_Tuple3( + newList, + $elm$core$Maybe$Just(newState), + newCmd); } else { - return _Utils_Tuple2(model, list); + return _Utils_Tuple3(list, $elm$core$Maybe$Nothing, $elm$core$Platform$Cmd$none); } - case 4: - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - {cV: state.a9}); - }, - model), - list); - case 5: + default: if (!model.$) { var state = model.a; - if (!_Utils_eq(state.a9, state.cV)) { - var equalGroups = A4($author$project$Internal$Groups$equalGroups, groups.cN, state.a9, state.cV, list); - return ((listen === 1) && equalGroups) ? _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A4( - $author$project$DnDList$Groups$sublistUpdate, - operation, - state.a9, - state.cV, - A3(beforeUpdate, state.a9, state.cV, list))) : (((groups.dg === 1) && (!equalGroups)) ? _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A6( - $author$project$DnDList$Groups$listUpdate, - groups.ds, - groups.cN, - groups.dC, - state.a9, - state.cV, - A3(beforeUpdate, state.a9, state.cV, list))) : _Utils_Tuple2($elm$core$Maybe$Nothing, list)); + if (!_Utils_eq(state.c, state.h)) { + var equalGroups = A4($author$project$Internal$Groups$equalGroups, settings.r.a$, state.c, state.h, list); + if ((settings.bp === 1) && equalGroups) { + var newList = A4( + $author$project$DnDList$Groups$groupUpdate, + settings.a9, + state.c, + state.h, + A3(options.aL, state.c, state.h, list)); + return _Utils_Tuple3( + newList, + $elm$core$Maybe$Nothing, + $elm$core$Platform$Cmd$batch( + _List_fromArray( + [ + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(newList)); + }, + options.aJ)) + ]))); + } else { + if ((settings.r.bp === 1) && (!equalGroups)) { + var newList = A6( + $author$project$DnDList$Groups$listUpdate, + settings.r.a9, + settings.r.a$, + settings.r.cj, + state.c, + state.h, + A3(options.aL, state.c, state.h, list)); + return _Utils_Tuple3( + newList, + $elm$core$Maybe$Nothing, + $elm$core$Platform$Cmd$batch( + _List_fromArray( + [ + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(newList)); + }, + options.aJ)) + ]))); + } else { + return _Utils_Tuple3(list, $elm$core$Maybe$Nothing, $elm$core$Platform$Cmd$none); + } + } } else { - return _Utils_Tuple2($elm$core$Maybe$Nothing, list); + return _Utils_Tuple3( + list, + $elm$core$Maybe$Nothing, + A2( + $elm$core$Maybe$withDefault, + $elm$core$Platform$Cmd$none, + A2( + $elm$core$Maybe$map, + function (f) { + return A2( + $elm$core$Task$perform, + A2(f, state.c, state.h), + $elm$core$Task$succeed(list)); + }, + options.aJ))); } } else { - return _Utils_Tuple2($elm$core$Maybe$Nothing, list); - } - case 6: - if (msg.a.$ === 1) { - return _Utils_Tuple2(model, list); - } else { - var dragElement = msg.a.a; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - { - P: $elm$core$Maybe$Just(dragElement), - ab: $elm$core$Maybe$Just(dragElement) - }); - }, - model), - list); - } - default: - if (msg.a.$ === 1) { - return _Utils_Tuple2(model, list); - } else { - var dropElement = msg.a.a; - return _Utils_Tuple2( - A2( - $elm$core$Maybe$map, - function (state) { - return _Utils_update( - state, - { - ab: $elm$core$Maybe$Just(dropElement) - }); - }, - model), - list); + return _Utils_Tuple3(list, $elm$core$Maybe$Nothing, $elm$core$Platform$Cmd$none); } } }); -var $author$project$DnDList$Groups$create = F2( - function (config, stepMsg) { - return { - cM: $author$project$DnDList$Groups$commands(stepMsg), - cT: $author$project$DnDList$Groups$dragEvents(stepMsg), - cU: $author$project$DnDList$Groups$dropEvents(stepMsg), - c$: $author$project$DnDList$Groups$ghostStyles, - be: $author$project$DnDList$Groups$info, - dj: $elm$core$Maybe$Nothing, - b5: $author$project$DnDList$Groups$subscriptions(stepMsg), - b9: $author$project$DnDList$Groups$update(config) - }; +var $author$project$DnDList$Groups$create = F2( + function (toMsg, configuration) { + return { + bL: $author$project$DnDList$Groups$dragEvents(toMsg), + bM: $author$project$DnDList$Groups$dropEvents(toMsg), + bS: $author$project$DnDList$Groups$ghostStyles(configuration), + bX: $author$project$DnDList$Groups$info, + b0: $elm$core$Maybe$Nothing, + cm: $author$project$DnDList$Groups$subscriptions(toMsg), + cq: A2($author$project$DnDList$Groups$update, configuration, toMsg) + }; + }); +var $author$project$DnDList$Groups$detectDrop = F2( + function (hook, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Groups$Config, + settings, + _Utils_update( + options, + { + aJ: $elm$core$Maybe$Just(hook) + })); + }); +var $author$project$DnDListGroups$HookCommands$DetectDrop$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$HookCommands$DetectDrop$DnDMsg, + A2($author$project$DnDList$Groups$detectDrop, $author$project$DnDListGroups$HookCommands$DetectDrop$DetectDrop, $author$project$DnDListGroups$HookCommands$DetectDrop$config)); +var $author$project$DnDListGroups$HookCommands$DetectDrop$initialModel = {Z: $author$project$DnDListGroups$HookCommands$DetectDrop$system.b0, aK: _List_Nil, av: $author$project$DnDListGroups$HookCommands$DetectDrop$preparedData}; +var $author$project$DnDListGroups$HookCommands$DetectReorder$Item = F3( + function (group, value, color) { + return {a_: color, x: group, aC: value}; + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$letterColor = '#1e9daa'; +var $author$project$DnDListGroups$HookCommands$DetectReorder$numberColor = '#aa1e9d'; +var $author$project$DnDListGroups$HookCommands$DetectReorder$transparent = 'transparent'; +var $author$project$DnDListGroups$HookCommands$DetectReorder$preparedData = _List_fromArray( + [ + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 1, 'F', $author$project$DnDListGroups$HookCommands$DetectReorder$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 1, '3', $author$project$DnDListGroups$HookCommands$DetectReorder$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 1, '1', $author$project$DnDListGroups$HookCommands$DetectReorder$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 1, 'L', $author$project$DnDListGroups$HookCommands$DetectReorder$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 1, 'A', $author$project$DnDListGroups$HookCommands$DetectReorder$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 1, '', $author$project$DnDListGroups$HookCommands$DetectReorder$transparent), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 2, '4', $author$project$DnDListGroups$HookCommands$DetectReorder$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 2, 'S', $author$project$DnDListGroups$HookCommands$DetectReorder$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 2, '8', $author$project$DnDListGroups$HookCommands$DetectReorder$numberColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 2, 'M', $author$project$DnDListGroups$HookCommands$DetectReorder$letterColor), + A3($author$project$DnDListGroups$HookCommands$DetectReorder$Item, 2, '', $author$project$DnDListGroups$HookCommands$DetectReorder$transparent) + ]); +var $author$project$DnDListGroups$HookCommands$DetectReorder$DetectReorder = F3( + function (a, b, c) { + return {$: 1, a: a, b: b, c: c}; + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$DnDMsg = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDListGroups$HookCommands$DetectReorder$comparator = F2( + function (item1, item2) { + return _Utils_eq(item1.x, item2.x); + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$setter = F2( + function (item1, item2) { + return _Utils_update( + item2, + {x: item1.x}); + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$HookCommands$DetectReorder$comparator, bp: 0, a9: 1, cj: $author$project$DnDListGroups$HookCommands$DetectReorder$setter}, + bp: 1, + a9: 2 + }); +var $author$project$DnDList$Groups$detectReorder = F2( + function (hook, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Groups$Config, + settings, + _Utils_update( + options, + { + a4: $elm$core$Maybe$Just(hook) + })); + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$HookCommands$DetectReorder$DnDMsg, + A2($author$project$DnDList$Groups$detectReorder, $author$project$DnDListGroups$HookCommands$DetectReorder$DetectReorder, $author$project$DnDListGroups$HookCommands$DetectReorder$config)); +var $author$project$DnDListGroups$HookCommands$DetectReorder$initialModel = {Z: $author$project$DnDListGroups$HookCommands$DetectReorder$system.b0, aK: _List_Nil, av: $author$project$DnDListGroups$HookCommands$DetectReorder$preparedData}; +var $author$project$DnDListGroups$HookCommands$Parent$initialModel = { + at: _List_fromArray( + [ + $author$project$DnDListGroups$HookCommands$Parent$DetectDrop($author$project$DnDListGroups$HookCommands$DetectDrop$initialModel), + $author$project$DnDListGroups$HookCommands$Parent$DetectReorder($author$project$DnDListGroups$HookCommands$DetectReorder$initialModel) + ]), + a7: 0 +}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfter = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBefore = function (a) { + return {$: 1, a: a}; +}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$Rotate = function (a) { + return {$: 2, a: a}; +}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$Swap = function (a) { + return {$: 3, a: a}; +}; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item = F3( + function (group, value, color) { + return {a_: color, x: group, aC: value}; + }); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$transparent = 'transparent'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$preparedData = _List_fromArray( + [ + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 1, '', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$transparent), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 2, '', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$transparent), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 3, '', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$transparent), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor) + ]); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$DnDMsg = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$affectedColor = 'purple'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$beforeUpdate = F3( + function (dragIndex, dropIndex, items) { + return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( + $elm$core$List$indexedMap, + F2( + function (i, item) { + return _Utils_eq(i, dragIndex) ? _Utils_update( + item, + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + item, + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( + item, + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$affectedColor}) : item)); + }), + items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( + $elm$core$List$indexedMap, + F2( + function (i, item) { + return _Utils_eq(i, dragIndex) ? _Utils_update( + item, + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + item, + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( + item, + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$affectedColor}) : item)); + }), + items) : items); + }); +var $author$project$DnDList$Groups$InsertAfter = 0; +var $author$project$DnDList$Groups$Unaltered = 4; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$comparator = F2( + function (item1, item2) { + return _Utils_eq(item1.x, item2.x); + }); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$setter = F2( + function (item1, item2) { + return _Utils_update( + item2, + {x: item1.x}); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$config, $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.dj, au: $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$preparedData}; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$comparator, bp: 0, a9: 0, cj: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$setter}, + bp: 0, + a9: 4 + }); +var $author$project$DnDList$Groups$hookItemsBeforeListUpdate = F2( + function (hook, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Groups$Config, + settings, + _Utils_update( + options, + {aL: hook})); + }); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$config)); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.b0, av: $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$preparedData}; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$transparent = 'transparent'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$preparedData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$transparent = 'transparent'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$preparedData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 1, '', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$transparent), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 2, '', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$transparent), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, 3, '', $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$transparent) + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 1, '', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$transparent), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 2, '', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$transparent), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, 3, '', $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$transparent) ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$Groups$InsertBefore = 1; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$affectedColor = 'purple'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$affectedColor = 'purple'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, @@ -7776,11 +8408,11 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$beforeUpdate = F3 function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$affectedColor}) : item)); + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$affectedColor}) : item)); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, @@ -7788,57 +8420,59 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$beforeUpdate = F3 function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$affectedColor}) : item)); + {a_: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$affectedColor}) : item)); }), items) : items); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$comparator = F2( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$config = { - cv: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$comparator, dg: 0, ds: 1, dC: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$setter}, - dg: 0, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$config, $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.dj, au: $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$preparedData}; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$comparator, bp: 0, a9: 1, cj: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$setter}, + bp: 0, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$config)); +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.b0, av: $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$preparedData}; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$gatheredData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$gatheredData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor) + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor) ]); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$Groups$Rotate = 2; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$affectedColor = 'purple'; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$affectedColor = 'purple'; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, @@ -7846,11 +8480,11 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Rotate$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$Rotate$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Rotate$affectedColor}) : item)); + {a_: $author$project$DnDListGroups$OperationsOnDrag$Rotate$affectedColor}) : item)); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, @@ -7858,56 +8492,58 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Rotate$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$Rotate$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Rotate$affectedColor}) : item)); + {a_: $author$project$DnDListGroups$OperationsOnDrag$Rotate$affectedColor}) : item)); }), items) : items); }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$comparator = F2( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$config = { - cv: $author$project$ConfigGroups$OperationsOnDrag$Rotate$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrag$Rotate$comparator, dg: 0, ds: 2, dC: $author$project$ConfigGroups$OperationsOnDrag$Rotate$setter}, - dg: 0, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrag$Rotate$config, $author$project$ConfigGroups$OperationsOnDrag$Rotate$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrag$Rotate$system.dj, au: $author$project$ConfigGroups$OperationsOnDrag$Rotate$gatheredData}; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrag$Rotate$comparator, bp: 0, a9: 2, cj: $author$project$DnDListGroups$OperationsOnDrag$Rotate$setter}, + bp: 0, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrag$Rotate$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrag$Rotate$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrag$Rotate$config)); +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrag$Rotate$system.b0, av: $author$project$DnDListGroups$OperationsOnDrag$Rotate$gatheredData}; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$gatheredData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$gatheredData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor) + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor) ]); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$Swap$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$DnDList$Groups$Swap = 3; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$indexedMap, @@ -7915,80 +8551,84 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Swap$dropColor}) : (_Utils_eq(i, dragIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrag$Swap$dropColor}) : (_Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrag$Swap$dragColor}) : item); + {a_: $author$project$DnDListGroups$OperationsOnDrag$Swap$dragColor}) : item); }), items) : items; }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$comparator = F2( +var $author$project$DnDList$Groups$Swap = 3; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); - }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$config = { - cv: $author$project$ConfigGroups$OperationsOnDrag$Swap$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrag$Swap$comparator, dg: 0, ds: 3, dC: $author$project$ConfigGroups$OperationsOnDrag$Swap$setter}, - dg: 0, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrag$Swap$config, $author$project$ConfigGroups$OperationsOnDrag$Swap$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrag$Swap$system.dj, au: $author$project$ConfigGroups$OperationsOnDrag$Swap$gatheredData}; -var $author$project$ConfigGroups$OperationsOnDrag$Root$initialModel = { - Q: _List_fromArray( + {x: item1.x}); + }); +var $author$project$DnDListGroups$OperationsOnDrag$Swap$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrag$Swap$comparator, bp: 0, a9: 3, cj: $author$project$DnDListGroups$OperationsOnDrag$Swap$setter}, + bp: 0, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrag$Swap$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrag$Swap$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrag$Swap$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrag$Swap$config)); +var $author$project$DnDListGroups$OperationsOnDrag$Swap$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrag$Swap$system.b0, av: $author$project$DnDListGroups$OperationsOnDrag$Swap$gatheredData}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$initialModel = { + at: _List_fromArray( [ - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfter($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$initialModel), - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBefore($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$initialModel), - $author$project$ConfigGroups$OperationsOnDrag$Root$Rotate($author$project$ConfigGroups$OperationsOnDrag$Rotate$initialModel), - $author$project$ConfigGroups$OperationsOnDrag$Root$Swap($author$project$ConfigGroups$OperationsOnDrag$Swap$initialModel) + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfter($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$initialModel), + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBefore($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$initialModel), + $author$project$DnDListGroups$OperationsOnDrag$Parent$Rotate($author$project$DnDListGroups$OperationsOnDrag$Rotate$initialModel), + $author$project$DnDListGroups$OperationsOnDrag$Parent$Swap($author$project$DnDListGroups$OperationsOnDrag$Swap$initialModel) ]), - at: 0 + a7: 0 }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfter = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfter = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBefore = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBefore = function (a) { return {$: 1, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$Rotate = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$Rotate = function (a) { return {$: 2, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$Swap = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$Swap = function (a) { return {$: 3, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$transparent = 'transparent'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$preparedData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$transparent = 'transparent'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$preparedData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 1, '', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$transparent), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 2, '', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$transparent), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 3, '', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$transparent), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor) + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 1, '', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$transparent), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 2, '', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$transparent), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 3, '', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$transparent), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor) ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$affectedColor = 'purple'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$affectedColor = 'purple'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, @@ -7996,13 +8636,13 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$affectedColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$affectedColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor}))); + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor}))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, @@ -8010,62 +8650,65 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$affectedColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$affectedColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor}))); + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor}))); }), items) : items); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$comparator = F2( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$config = { - cv: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$comparator, dg: 1, ds: 0, dC: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$setter}, - dg: 1, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$config, $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.dj, au: $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$preparedData}; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$comparator, bp: 1, a9: 0, cj: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$setter}, + bp: 1, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$config)); +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.b0, av: $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$preparedData}; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$transparent = 'transparent'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$preparedData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$transparent = 'transparent'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$preparedData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 1, '', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$transparent), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 2, '', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$transparent), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, 3, '', $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$transparent) + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 1, '', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$transparent), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 2, '', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$transparent), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, 3, '', $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$transparent) ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$affectedColor = 'purple'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$affectedColor = 'purple'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, @@ -8073,13 +8716,13 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$beforeUpdate = F3 function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$affectedColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$affectedColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor}))); + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor}))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, @@ -8087,58 +8730,61 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$beforeUpdate = F3 function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$affectedColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$affectedColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor}))); + {a_: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor}))); }), items) : items); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$comparator = F2( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$config = { - cv: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$comparator, dg: 1, ds: 1, dC: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$setter}, - dg: 1, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$config, $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.dj, au: $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$preparedData}; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$comparator, bp: 1, a9: 1, cj: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$setter}, + bp: 1, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$config)); +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.b0, av: $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$preparedData}; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$gatheredData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$gatheredData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor) + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor) ]); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$affectedColor = 'purple'; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$affectedColor = 'purple'; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (_Utils_cmp(dragIndex, dropIndex) < 0) ? A2( $elm$core$List$indexedMap, @@ -8146,13 +8792,13 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$dropColor}) : (((_Utils_cmp(dragIndex, i) < 0) && (_Utils_cmp(i, dropIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$affectedColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$affectedColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor}))); + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor}))); }), items) : ((_Utils_cmp(dragIndex, dropIndex) > 0) ? A2( $elm$core$List$indexedMap, @@ -8160,57 +8806,60 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$dragColor}) : (_Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$dropColor}) : (((_Utils_cmp(dropIndex, i) < 0) && (_Utils_cmp(i, dragIndex) < 0)) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$affectedColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$affectedColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor}))); + {a_: $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor}))); }), items) : items); }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$comparator = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$config = { - cv: $author$project$ConfigGroups$OperationsOnDrop$Rotate$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrop$Rotate$comparator, dg: 1, ds: 2, dC: $author$project$ConfigGroups$OperationsOnDrop$Rotate$setter}, - dg: 1, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrop$Rotate$config, $author$project$ConfigGroups$OperationsOnDrop$Rotate$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrop$Rotate$system.dj, au: $author$project$ConfigGroups$OperationsOnDrop$Rotate$gatheredData}; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$Item = F3( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrop$Rotate$comparator, bp: 1, a9: 2, cj: $author$project$DnDListGroups$OperationsOnDrop$Rotate$setter}, + bp: 1, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrop$Rotate$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrop$Rotate$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrop$Rotate$config)); +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrop$Rotate$system.b0, av: $author$project$DnDListGroups$OperationsOnDrop$Rotate$gatheredData}; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor = 'dimgray'; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$gatheredData = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor = 'dimgray'; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$gatheredData = _List_fromArray( [ - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 1, '1', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 2, '2', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 2, '3', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 2, '4', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 3, '5', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 3, '6', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 3, '7', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 3, '8', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor), - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, 3, '9', $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor) + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 1, '1', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 2, '2', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 2, '3', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 2, '4', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 3, '5', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 3, '6', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 3, '7', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 3, '8', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, 3, '9', $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor) ]); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$MyMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Swap$DnDMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$dragColor = 'red'; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$dropColor = 'green'; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$beforeUpdate = F3( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$dragColor = 'red'; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$dropColor = 'green'; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$beforeUpdate = F3( function (dragIndex, dropIndex, items) { return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$indexedMap, @@ -8218,58 +8867,63 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$beforeUpdate = F3( function (i, item) { return _Utils_eq(i, dropIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Swap$dropColor}) : (_Utils_eq(i, dragIndex) ? _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Swap$dropColor}) : (_Utils_eq(i, dragIndex) ? _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Swap$dragColor}) : _Utils_update( + {a_: $author$project$DnDListGroups$OperationsOnDrop$Swap$dragColor}) : _Utils_update( item, - {aV: $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor})); + {a_: $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor})); }), items) : items; }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$comparator = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$setter = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); - }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$config = { - cv: $author$project$ConfigGroups$OperationsOnDrop$Swap$beforeUpdate, - c1: {cN: $author$project$ConfigGroups$OperationsOnDrop$Swap$comparator, dg: 1, ds: 3, dC: $author$project$ConfigGroups$OperationsOnDrop$Swap$setter}, - dg: 1, - ds: 4 -}; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$system = A2($author$project$DnDList$Groups$create, $author$project$ConfigGroups$OperationsOnDrop$Swap$config, $author$project$ConfigGroups$OperationsOnDrop$Swap$MyMsg); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$initialModel = {aa: $author$project$ConfigGroups$OperationsOnDrop$Swap$system.dj, au: $author$project$ConfigGroups$OperationsOnDrop$Swap$gatheredData}; -var $author$project$ConfigGroups$OperationsOnDrop$Root$initialModel = { - Q: _List_fromArray( + {x: item1.x}); + }); +var $author$project$DnDListGroups$OperationsOnDrop$Swap$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$DnDListGroups$OperationsOnDrop$Swap$comparator, bp: 1, a9: 3, cj: $author$project$DnDListGroups$OperationsOnDrop$Swap$setter}, + bp: 1, + a9: 4 + }); +var $author$project$DnDListGroups$OperationsOnDrop$Swap$system = A2( + $author$project$DnDList$Groups$create, + $author$project$DnDListGroups$OperationsOnDrop$Swap$DnDMsg, + A2($author$project$DnDList$Groups$hookItemsBeforeListUpdate, $author$project$DnDListGroups$OperationsOnDrop$Swap$beforeUpdate, $author$project$DnDListGroups$OperationsOnDrop$Swap$config)); +var $author$project$DnDListGroups$OperationsOnDrop$Swap$initialModel = {Z: $author$project$DnDListGroups$OperationsOnDrop$Swap$system.b0, av: $author$project$DnDListGroups$OperationsOnDrop$Swap$gatheredData}; +var $author$project$DnDListGroups$OperationsOnDrop$Parent$initialModel = { + at: _List_fromArray( [ - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfter($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$initialModel), - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBefore($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$initialModel), - $author$project$ConfigGroups$OperationsOnDrop$Root$Rotate($author$project$ConfigGroups$OperationsOnDrop$Rotate$initialModel), - $author$project$ConfigGroups$OperationsOnDrop$Root$Swap($author$project$ConfigGroups$OperationsOnDrop$Swap$initialModel) + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfter($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$initialModel), + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBefore($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$initialModel), + $author$project$DnDListGroups$OperationsOnDrop$Parent$Rotate($author$project$DnDListGroups$OperationsOnDrop$Rotate$initialModel), + $author$project$DnDListGroups$OperationsOnDrop$Parent$Swap($author$project$DnDListGroups$OperationsOnDrop$Swap$initialModel) ]), - at: 0 + a7: 0 }; -var $author$project$ConfigGroups$Root$toExample = function (slug) { +var $author$project$DnDListGroups$Parent$toExample = function (slug) { switch (slug) { case 'operations-drag': - return $author$project$ConfigGroups$Root$OperationsOnDrag($author$project$ConfigGroups$OperationsOnDrag$Root$initialModel); + return $author$project$DnDListGroups$Parent$OperationsOnDrag($author$project$DnDListGroups$OperationsOnDrag$Parent$initialModel); case 'operations-drop': - return $author$project$ConfigGroups$Root$OperationsOnDrop($author$project$ConfigGroups$OperationsOnDrop$Root$initialModel); + return $author$project$DnDListGroups$Parent$OperationsOnDrop($author$project$DnDListGroups$OperationsOnDrop$Parent$initialModel); + case 'hook-commands': + return $author$project$DnDListGroups$Parent$HookCommands($author$project$DnDListGroups$HookCommands$Parent$initialModel); default: - return $author$project$ConfigGroups$Root$OperationsOnDrag($author$project$ConfigGroups$OperationsOnDrag$Root$initialModel); + return $author$project$DnDListGroups$Parent$OperationsOnDrag($author$project$DnDListGroups$OperationsOnDrag$Parent$initialModel); } }; -var $author$project$ConfigGroups$Root$init = function (slug) { +var $author$project$DnDListGroups$Parent$init = function (slug) { return _Utils_Tuple2( - $author$project$ConfigGroups$Root$toExample(slug), + $author$project$DnDListGroups$Parent$toExample(slug), $elm$core$Platform$Cmd$none); }; -var $author$project$Gallery$Root$PuzzleMsg = function (a) { +var $author$project$Gallery$Parent$PuzzleMsg = function (a) { return {$: 1, a: a}; }; var $author$project$Gallery$Puzzle$NewGame = function (a) { @@ -8306,8 +8960,6 @@ var $elm$time$Time$Zone = F2( return {$: 0, a: a, b: b}; }); var $elm$time$Time$customZone = $elm$time$Time$Zone; -var $elm$time$Time$Posix = $elm$core$Basics$identity; -var $elm$time$Time$millisToPosix = $elm$core$Basics$identity; var $elm$time$Time$now = _Time_now($elm$time$Time$millisToPosix); var $elm$time$Time$posixToMillis = function (_v0) { var millis = _v0; @@ -8512,7 +9164,7 @@ var $author$project$Gallery$Puzzle$shuffle = function (list) { }; var $author$project$Gallery$Puzzle$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); var $author$project$Gallery$Puzzle$blue = '#448ff8'; var $author$project$Gallery$Puzzle$cyan = '#44bcf8'; @@ -8541,29 +9193,28 @@ var $author$project$Gallery$Puzzle$commands = A2( $elm$random$Random$generate, $author$project$Gallery$Puzzle$NewGame, $author$project$Gallery$Puzzle$shuffle($author$project$Gallery$Puzzle$solution)); -var $elm$core$Platform$Cmd$map = _Platform_map; -var $author$project$Gallery$Root$commands = A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$PuzzleMsg, $author$project$Gallery$Puzzle$commands); -var $author$project$Gallery$Root$Hanoi = function (a) { +var $author$project$Gallery$Parent$commands = A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$PuzzleMsg, $author$project$Gallery$Puzzle$commands); +var $author$project$Gallery$Parent$Hanoi = function (a) { return {$: 0, a: a}; }; -var $author$project$Gallery$Root$Knight = function (a) { +var $author$project$Gallery$Parent$Knight = function (a) { return {$: 3, a: a}; }; -var $author$project$Gallery$Root$Puzzle = function (a) { +var $author$project$Gallery$Parent$Puzzle = function (a) { return {$: 1, a: a}; }; -var $author$project$Gallery$Root$Shapes = function (a) { +var $author$project$Gallery$Parent$Shapes = function (a) { return {$: 2, a: a}; }; -var $author$project$Gallery$Root$TaskBoard = function (a) { +var $author$project$Gallery$Parent$TaskBoard = function (a) { return {$: 5, a: a}; }; -var $author$project$Gallery$Root$TryOn = function (a) { +var $author$project$Gallery$Parent$TryOn = function (a) { return {$: 4, a: a}; }; var $author$project$Gallery$Hanoi$Disk = F4( function (tower, width, startColor, solvedColor) { - return {bn: solvedColor, a1: startColor, aP: tower, d4: width}; + return {bx: solvedColor, bb: startColor, aT: tower, aW: width}; }); var $author$project$Gallery$Hanoi$data = _List_fromArray( [ @@ -8575,7 +9226,9 @@ var $author$project$Gallery$Hanoi$data = _List_fromArray( A4($author$project$Gallery$Hanoi$Disk, 1, 300, 'transparent', 'transparent'), A4($author$project$Gallery$Hanoi$Disk, 2, 300, 'transparent', 'transparent') ]); -var $author$project$Gallery$Hanoi$MyMsg = $elm$core$Basics$identity; +var $author$project$Gallery$Hanoi$DnDMsg = $elm$core$Basics$identity; +var $author$project$Gallery$Hanoi$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 0}); var $author$project$Gallery$Hanoi$updateTower = F3( function (dragIndex, dropIndex, list) { var drops = A2( @@ -8593,7 +9246,7 @@ var $author$project$Gallery$Hanoi$updateTower = F3( function (dragDisk, dropDisk) { return _Utils_update( dragDisk, - {aP: dropDisk.aP}); + {aT: dropDisk.aT}); }), _List_fromArray( [item]), @@ -8602,16 +9255,18 @@ var $author$project$Gallery$Hanoi$updateTower = F3( }), list)); }); -var $author$project$Gallery$Hanoi$config = {cv: $author$project$Gallery$Hanoi$updateTower, dg: 1, dk: 0, ds: 0}; -var $author$project$Gallery$Hanoi$system = A2($author$project$DnDList$create, $author$project$Gallery$Hanoi$config, $elm$core$Basics$identity); -var $author$project$Gallery$Hanoi$initialModel = {O: $author$project$Gallery$Hanoi$data, aa: $author$project$Gallery$Hanoi$system.dj, aL: false}; +var $author$project$Gallery$Hanoi$system = A2( + $author$project$DnDList$create, + $elm$core$Basics$identity, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$Gallery$Hanoi$updateTower, $author$project$Gallery$Hanoi$config)); +var $author$project$Gallery$Hanoi$initialModel = {P: $author$project$Gallery$Hanoi$data, Z: $author$project$Gallery$Hanoi$system.b0, aP: false}; var $author$project$Gallery$Knight$squares5x5 = A2( $elm$core$List$map, function (index5) { return (index5 === 12) ? 'N' : ''; }, A2($elm$core$List$range, 0, 24)); -var $author$project$Gallery$Knight$MyMsg = $elm$core$Basics$identity; +var $author$project$Gallery$Knight$DnDMsg = $elm$core$Basics$identity; var $author$project$Gallery$Knight$beforeUpdate = F3( function (dragIndex, dropIndex, squares) { return A2( @@ -8622,38 +9277,39 @@ var $author$project$Gallery$Knight$beforeUpdate = F3( }), squares); }); -var $author$project$Gallery$Knight$config = {cv: $author$project$Gallery$Knight$beforeUpdate, dg: 1, dk: 0, ds: 3}; -var $author$project$Gallery$Knight$system = A2($author$project$DnDList$create, $author$project$Gallery$Knight$config, $elm$core$Basics$identity); -var $author$project$Gallery$Knight$initialModel = {aa: $author$project$Gallery$Knight$system.dj, aL: false, az: $author$project$Gallery$Knight$squares5x5}; -var $author$project$Gallery$Puzzle$MyMsg = function (a) { +var $author$project$Gallery$Knight$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 3}); +var $author$project$Gallery$Knight$system = A2( + $author$project$DnDList$create, + $elm$core$Basics$identity, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$Gallery$Knight$beforeUpdate, $author$project$Gallery$Knight$config)); +var $author$project$Gallery$Knight$initialModel = {Z: $author$project$Gallery$Knight$system.b0, aP: false, aB: $author$project$Gallery$Knight$squares5x5}; +var $author$project$Gallery$Puzzle$DnDMsg = function (a) { return {$: 1, a: a}; }; var $author$project$Gallery$Puzzle$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); var $author$project$Gallery$Puzzle$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$Gallery$Puzzle$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - c1: {cN: $author$project$Gallery$Puzzle$comparator, dg: 1, ds: 3, dC: $author$project$Gallery$Puzzle$setter}, - dg: 0, - ds: 3 -}; -var $author$project$Gallery$Puzzle$system = A2($author$project$DnDList$Groups$create, $author$project$Gallery$Puzzle$config, $author$project$Gallery$Puzzle$MyMsg); -var $author$project$Gallery$Puzzle$initialModel = {aa: $author$project$Gallery$Puzzle$system.dj, au: _List_Nil}; +var $author$project$Gallery$Puzzle$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$Gallery$Puzzle$comparator, bp: 1, a9: 3, cj: $author$project$Gallery$Puzzle$setter}, + bp: 0, + a9: 3 + }); +var $author$project$Gallery$Puzzle$system = A2($author$project$DnDList$Groups$create, $author$project$Gallery$Puzzle$DnDMsg, $author$project$Gallery$Puzzle$config); +var $author$project$Gallery$Puzzle$initialModel = {Z: $author$project$Gallery$Puzzle$system.b0, av: _List_Nil}; var $author$project$Gallery$Shapes$Circle = 0; var $author$project$Gallery$Shapes$Cross = 1; var $author$project$Gallery$Shapes$Item = F4( function (shape, color, attempts, solved) { - return {am: attempts, aV: color, ax: shape, aL: solved}; + return {al: attempts, a_: color, ay: shape, aP: solved}; }); var $author$project$Gallery$Shapes$Square = 2; var $author$project$Gallery$Shapes$Triangle = 3; @@ -8668,7 +9324,9 @@ var $author$project$Gallery$Shapes$data = _List_fromArray( A4($author$project$Gallery$Shapes$Item, 1, 'dimgray', 0, false), A4($author$project$Gallery$Shapes$Item, 0, 'dimgray', 0, false) ]); -var $author$project$Gallery$Shapes$MyMsg = $elm$core$Basics$identity; +var $author$project$Gallery$Shapes$DnDMsg = $elm$core$Basics$identity; +var $author$project$Gallery$Shapes$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 4}); var $author$project$Gallery$Shapes$updateShapes = F3( function (dragIndex, dropIndex, list) { var drops = A2( @@ -8687,7 +9345,7 @@ var $author$project$Gallery$Shapes$updateShapes = F3( $elm$core$List$map2, F2( function (dragItem, dropItem) { - return _Utils_eq(dragItem.ax, dropItem.ax); + return _Utils_eq(dragItem.ay, dropItem.ay); }), drags, drops)); @@ -8700,14 +9358,14 @@ var $author$project$Gallery$Shapes$updateShapes = F3( [ _Utils_update( item, - {aV: 'transparent', aL: true}) + {a_: 'transparent', aP: true}) ]) : ((_Utils_eq(index, dropIndex) && fit) ? A3( $elm$core$List$map2, F2( function (dragItem, dropItem) { return _Utils_update( dropItem, - {am: dropItem.am + 1, aV: dragItem.aV, aL: true}); + {al: dropItem.al + 1, a_: dragItem.a_, aP: true}); }), drags, _List_fromArray( @@ -8715,54 +9373,46 @@ var $author$project$Gallery$Shapes$updateShapes = F3( [ _Utils_update( item, - {am: item.am + 1}) + {al: item.al + 1}) ]) : _List_fromArray( [item]))); }), list)); }); -var $author$project$Gallery$Shapes$config = {cv: $author$project$Gallery$Shapes$updateShapes, dg: 1, dk: 0, ds: 4}; -var $author$project$Gallery$Shapes$system = A2($author$project$DnDList$create, $author$project$Gallery$Shapes$config, $elm$core$Basics$identity); -var $author$project$Gallery$Shapes$initialModel = {aa: $author$project$Gallery$Shapes$system.dj, au: $author$project$Gallery$Shapes$data}; +var $author$project$Gallery$Shapes$system = A2( + $author$project$DnDList$create, + $elm$core$Basics$identity, + A2($author$project$DnDList$hookItemsBeforeListUpdate, $author$project$Gallery$Shapes$updateShapes, $author$project$Gallery$Shapes$config)); +var $author$project$Gallery$Shapes$initialModel = {Z: $author$project$Gallery$Shapes$system.b0, av: $author$project$Gallery$Shapes$data}; var $author$project$Gallery$TaskBoard$CardMoved = function (a) { return {$: 0, a: a}; }; var $author$project$Gallery$TaskBoard$comparator = F2( function (card1, card2) { - return _Utils_eq(card1.r, card2.r); + return _Utils_eq(card1.t, card2.t); }); var $author$project$Gallery$TaskBoard$setter = F2( function (card1, card2) { return _Utils_update( card2, - {r: card1.r}); + {t: card1.t}); }); -var $author$project$Gallery$TaskBoard$cardConfig = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - c1: {cN: $author$project$Gallery$TaskBoard$comparator, dg: 0, ds: 1, dC: $author$project$Gallery$TaskBoard$setter}, - dg: 0, - ds: 2 -}; -var $author$project$Gallery$TaskBoard$cardSystem = A2($author$project$DnDList$Groups$create, $author$project$Gallery$TaskBoard$cardConfig, $author$project$Gallery$TaskBoard$CardMoved); +var $author$project$Gallery$TaskBoard$cardConfig = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$Gallery$TaskBoard$comparator, bp: 0, a9: 1, cj: $author$project$Gallery$TaskBoard$setter}, + bp: 0, + a9: 2 + }); +var $author$project$Gallery$TaskBoard$cardSystem = A2($author$project$DnDList$Groups$create, $author$project$Gallery$TaskBoard$CardMoved, $author$project$Gallery$TaskBoard$cardConfig); var $author$project$Gallery$TaskBoard$ColumnMoved = function (a) { return {$: 1, a: a}; }; -var $author$project$Gallery$TaskBoard$columnConfig = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 2 -}; -var $author$project$Gallery$TaskBoard$columnSystem = A2($author$project$DnDList$create, $author$project$Gallery$TaskBoard$columnConfig, $author$project$Gallery$TaskBoard$ColumnMoved); +var $author$project$Gallery$TaskBoard$columnConfig = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 2}); +var $author$project$Gallery$TaskBoard$columnSystem = A2($author$project$DnDList$create, $author$project$Gallery$TaskBoard$ColumnMoved, $author$project$Gallery$TaskBoard$columnConfig); var $author$project$Gallery$TaskBoard$Card = F2( function (activity, description) { - return {r: activity, aG: description}; + return {t: activity, ap: description}; }); var $author$project$Gallery$TaskBoard$Doing = 1; var $author$project$Gallery$TaskBoard$Done = 2; @@ -8780,11 +9430,11 @@ var $author$project$Gallery$TaskBoard$data = _List_fromArray( A2($author$project$Gallery$TaskBoard$Card, 2, 'E'), A2($author$project$Gallery$TaskBoard$Card, 2, '') ]); -var $author$project$Gallery$TaskBoard$initialModel = {K: $author$project$Gallery$TaskBoard$cardSystem.dj, C: $author$project$Gallery$TaskBoard$data, M: $author$project$Gallery$TaskBoard$columnSystem.dj}; +var $author$project$Gallery$TaskBoard$initialModel = {K: $author$project$Gallery$TaskBoard$cardSystem.b0, D: $author$project$Gallery$TaskBoard$data, M: $author$project$Gallery$TaskBoard$columnSystem.b0}; var $author$project$Gallery$TryOn$Color = 0; var $author$project$Gallery$TryOn$Item = F4( function (id, property, size, color) { - return {aV: color, at: id, aI: property, aJ: size}; + return {a_: color, a7: id, aN: property, aO: size}; }); var $author$project$Gallery$TryOn$Size = 1; var $author$project$Gallery$TryOn$data = _List_fromArray( @@ -8799,7 +9449,20 @@ var $author$project$Gallery$TryOn$data = _List_fromArray( A4($author$project$Gallery$TryOn$Item, 'id-8', 1, 4, 'dimgray'), A4($author$project$Gallery$TryOn$Item, 'id-9', 1, 5, 'dimgray') ]); -var $author$project$Gallery$TryOn$MyMsg = $elm$core$Basics$identity; +var $author$project$Gallery$TryOn$DnDMsg = $elm$core$Basics$identity; +var $author$project$Gallery$TryOn$config = $author$project$DnDList$config( + {bp: 1, b2: 0, a9: 4}); +var $author$project$DnDList$ghostProperties = F2( + function (properties, _v0) { + var settings = _v0.a; + var options = _v0.b; + return A2( + $author$project$DnDList$Config, + settings, + _Utils_update( + options, + {a5: properties})); + }); var $author$project$Gallery$TryOn$updateColor = F3( function (dragIndex, dropIndex, list) { var drags = A2( @@ -8818,20 +9481,20 @@ var $author$project$Gallery$TryOn$updateColor = F3( function (dragItem, dropItem) { return _Utils_update( dropItem, - {aV: dragItem.aV}); + {a_: dragItem.a_}); }), drags, _List_fromArray( [item])); } else { if (_Utils_eq(index, dragIndex)) { - var _v0 = item.aI; + var _v0 = item.aN; if (_v0 === 1) { return _List_fromArray( [ _Utils_update( item, - {aV: 'dimgray'}) + {a_: 'dimgray'}) ]); } else { return _List_fromArray( @@ -8845,33 +9508,42 @@ var $author$project$Gallery$TryOn$updateColor = F3( }), list)); }); -var $author$project$Gallery$TryOn$config = {cv: $author$project$Gallery$TryOn$updateColor, dg: 1, dk: 0, ds: 4}; -var $author$project$Gallery$TryOn$system = A2($author$project$DnDList$create, $author$project$Gallery$TryOn$config, $elm$core$Basics$identity); -var $author$project$Gallery$TryOn$initialModel = {aa: $author$project$Gallery$TryOn$system.dj, au: $author$project$Gallery$TryOn$data}; -var $author$project$Gallery$Root$toExample = function (slug) { +var $author$project$Gallery$TryOn$system = A2( + $author$project$DnDList$create, + $elm$core$Basics$identity, + A2( + $author$project$DnDList$hookItemsBeforeListUpdate, + $author$project$Gallery$TryOn$updateColor, + A2( + $author$project$DnDList$ghostProperties, + _List_fromArray( + ['position']), + $author$project$Gallery$TryOn$config))); +var $author$project$Gallery$TryOn$initialModel = {Z: $author$project$Gallery$TryOn$system.b0, av: $author$project$Gallery$TryOn$data}; +var $author$project$Gallery$Parent$toExample = function (slug) { switch (slug) { case 'hanoi': - return $author$project$Gallery$Root$Hanoi($author$project$Gallery$Hanoi$initialModel); + return $author$project$Gallery$Parent$Hanoi($author$project$Gallery$Hanoi$initialModel); case 'puzzle': - return $author$project$Gallery$Root$Puzzle($author$project$Gallery$Puzzle$initialModel); + return $author$project$Gallery$Parent$Puzzle($author$project$Gallery$Puzzle$initialModel); case 'shapes': - return $author$project$Gallery$Root$Shapes($author$project$Gallery$Shapes$initialModel); + return $author$project$Gallery$Parent$Shapes($author$project$Gallery$Shapes$initialModel); case 'knight': - return $author$project$Gallery$Root$Knight($author$project$Gallery$Knight$initialModel); + return $author$project$Gallery$Parent$Knight($author$project$Gallery$Knight$initialModel); case 'try-on': - return $author$project$Gallery$Root$TryOn($author$project$Gallery$TryOn$initialModel); + return $author$project$Gallery$Parent$TryOn($author$project$Gallery$TryOn$initialModel); case 'taskboard': - return $author$project$Gallery$Root$TaskBoard($author$project$Gallery$TaskBoard$initialModel); + return $author$project$Gallery$Parent$TaskBoard($author$project$Gallery$TaskBoard$initialModel); default: - return $author$project$Gallery$Root$Hanoi($author$project$Gallery$Hanoi$initialModel); + return $author$project$Gallery$Parent$Hanoi($author$project$Gallery$Hanoi$initialModel); } }; -var $author$project$Gallery$Root$init = function (slug) { +var $author$project$Gallery$Parent$init = function (slug) { return _Utils_Tuple2( - $author$project$Gallery$Root$toExample(slug), - $author$project$Gallery$Root$commands); + $author$project$Gallery$Parent$toExample(slug), + $author$project$Gallery$Parent$commands); }; -var $author$project$Introduction$Root$MasonryMsg = function (a) { +var $author$project$Introduction$Parent$MasonryMsg = function (a) { return {$: 5, a: a}; }; var $author$project$Introduction$Masonry$NewMasonry = function (a) { @@ -8915,65 +9587,51 @@ var $author$project$Introduction$Masonry$commands = A2( $elm$random$Random$list, $elm$core$List$length($author$project$Introduction$Masonry$colors), A2($elm$random$Random$int, 50, 200))); -var $author$project$Introduction$Root$commands = A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$MasonryMsg, $author$project$Introduction$Masonry$commands); -var $author$project$Introduction$Root$Basic = function (a) { +var $author$project$Introduction$Parent$commands = A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$MasonryMsg, $author$project$Introduction$Masonry$commands); +var $author$project$Introduction$Parent$Basic = function (a) { return {$: 0, a: a}; }; -var $author$project$Introduction$Root$BasicElmUI = function (a) { +var $author$project$Introduction$Parent$BasicElmUI = function (a) { return {$: 1, a: a}; }; -var $author$project$Introduction$Root$Groups = function (a) { +var $author$project$Introduction$Parent$Groups = function (a) { return {$: 8, a: a}; }; -var $author$project$Introduction$Root$Handle = function (a) { +var $author$project$Introduction$Parent$Handle = function (a) { return {$: 2, a: a}; }; -var $author$project$Introduction$Root$Independents = function (a) { +var $author$project$Introduction$Parent$Independents = function (a) { return {$: 7, a: a}; }; -var $author$project$Introduction$Root$Keyed = function (a) { +var $author$project$Introduction$Parent$Keyed = function (a) { return {$: 3, a: a}; }; -var $author$project$Introduction$Root$Margins = function (a) { +var $author$project$Introduction$Parent$Margins = function (a) { return {$: 4, a: a}; }; -var $author$project$Introduction$Root$Masonry = function (a) { +var $author$project$Introduction$Parent$Masonry = function (a) { return {$: 5, a: a}; }; -var $author$project$Introduction$Root$Resize = function (a) { +var $author$project$Introduction$Parent$Resize = function (a) { return {$: 6, a: a}; }; var $author$project$Introduction$Basic$data = _List_fromArray( ['Apples', 'Bananas', 'Cherries', 'Dates']); -var $author$project$Introduction$Basic$MyMsg = $elm$core$Basics$identity; -var $author$project$Introduction$Basic$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 2 -}; -var $author$project$Introduction$Basic$system = A2($author$project$DnDList$create, $author$project$Introduction$Basic$config, $elm$core$Basics$identity); -var $author$project$Introduction$Basic$initialModel = {aa: $author$project$Introduction$Basic$system.dj, au: $author$project$Introduction$Basic$data}; +var $author$project$Introduction$Basic$DnDMsg = $elm$core$Basics$identity; +var $author$project$Introduction$Basic$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 2}); +var $author$project$Introduction$Basic$system = A2($author$project$DnDList$create, $elm$core$Basics$identity, $author$project$Introduction$Basic$config); +var $author$project$Introduction$Basic$initialModel = {Z: $author$project$Introduction$Basic$system.b0, av: $author$project$Introduction$Basic$data}; var $author$project$Introduction$BasicElmUI$data = _List_fromArray( ['Apples', 'Bananas', 'Cherries', 'Dates']); -var $author$project$Introduction$BasicElmUI$MyMsg = $elm$core$Basics$identity; -var $author$project$Introduction$BasicElmUI$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 2 -}; -var $author$project$Introduction$BasicElmUI$system = A2($author$project$DnDList$create, $author$project$Introduction$BasicElmUI$config, $elm$core$Basics$identity); -var $author$project$Introduction$BasicElmUI$initialModel = {aa: $author$project$Introduction$BasicElmUI$system.dj, au: $author$project$Introduction$BasicElmUI$data}; +var $author$project$Introduction$BasicElmUI$DnDMsg = $elm$core$Basics$identity; +var $author$project$Introduction$BasicElmUI$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 2}); +var $author$project$Introduction$BasicElmUI$system = A2($author$project$DnDList$create, $elm$core$Basics$identity, $author$project$Introduction$BasicElmUI$config); +var $author$project$Introduction$BasicElmUI$initialModel = {Z: $author$project$Introduction$BasicElmUI$system.b0, av: $author$project$Introduction$BasicElmUI$data}; var $author$project$Introduction$Groups$Item = F3( function (group, value, color) { - return {aV: color, t: group, aB: value}; + return {a_: color, x: group, aC: value}; }); var $author$project$Introduction$Groups$Left = 0; var $author$project$Introduction$Groups$Right = 1; @@ -8991,73 +9649,49 @@ var $author$project$Introduction$Groups$preparedData = _List_fromArray( A3($author$project$Introduction$Groups$Item, 1, 'B', $author$project$Introduction$Groups$blue), A3($author$project$Introduction$Groups$Item, 1, 'footer', $author$project$Introduction$Groups$transparent) ]); -var $author$project$Introduction$Groups$MyMsg = $elm$core$Basics$identity; +var $author$project$Introduction$Groups$DnDMsg = $elm$core$Basics$identity; var $author$project$Introduction$Groups$comparator = F2( function (item1, item2) { - return _Utils_eq(item1.t, item2.t); + return _Utils_eq(item1.x, item2.x); }); var $author$project$Introduction$Groups$setter = F2( function (item1, item2) { return _Utils_update( item2, - {t: item1.t}); + {x: item1.x}); }); -var $author$project$Introduction$Groups$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - c1: {cN: $author$project$Introduction$Groups$comparator, dg: 0, ds: 1, dC: $author$project$Introduction$Groups$setter}, - dg: 0, - ds: 2 -}; -var $author$project$Introduction$Groups$system = A2($author$project$DnDList$Groups$create, $author$project$Introduction$Groups$config, $elm$core$Basics$identity); -var $author$project$Introduction$Groups$initialModel = {aa: $author$project$Introduction$Groups$system.dj, au: $author$project$Introduction$Groups$preparedData}; +var $author$project$Introduction$Groups$config = $author$project$DnDList$Groups$config( + { + r: {a$: $author$project$Introduction$Groups$comparator, bp: 0, a9: 1, cj: $author$project$Introduction$Groups$setter}, + bp: 0, + a9: 2 + }); +var $author$project$Introduction$Groups$system = A2($author$project$DnDList$Groups$create, $elm$core$Basics$identity, $author$project$Introduction$Groups$config); +var $author$project$Introduction$Groups$initialModel = {Z: $author$project$Introduction$Groups$system.b0, av: $author$project$Introduction$Groups$preparedData}; var $author$project$Introduction$Handle$data = _List_fromArray( ['Apples', 'Bananas', 'Cherries', 'Dates']); -var $author$project$Introduction$Handle$MyMsg = $elm$core$Basics$identity; -var $author$project$Introduction$Handle$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Handle$system = A2($author$project$DnDList$create, $author$project$Introduction$Handle$config, $elm$core$Basics$identity); -var $author$project$Introduction$Handle$initialModel = {aa: $author$project$Introduction$Handle$system.dj, as: $author$project$Introduction$Handle$data}; +var $author$project$Introduction$Handle$DnDMsg = $elm$core$Basics$identity; +var $author$project$Introduction$Handle$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Handle$system = A2($author$project$DnDList$create, $elm$core$Basics$identity, $author$project$Introduction$Handle$config); +var $author$project$Introduction$Handle$initialModel = {Z: $author$project$Introduction$Handle$system.b0, au: $author$project$Introduction$Handle$data}; var $author$project$Introduction$Independents$blueData = _List_fromArray( ['A', 'B', 'C', 'D']); var $author$project$Introduction$Independents$BlueMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Introduction$Independents$blueConfig = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Independents$blueSystem = A2($author$project$DnDList$create, $author$project$Introduction$Independents$blueConfig, $author$project$Introduction$Independents$BlueMsg); +var $author$project$Introduction$Independents$blueConfig = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Independents$blueSystem = A2($author$project$DnDList$create, $author$project$Introduction$Independents$BlueMsg, $author$project$Introduction$Independents$blueConfig); var $author$project$Introduction$Independents$redData = _List_fromArray( ['1', '2', '3', '4']); var $author$project$Introduction$Independents$RedMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Introduction$Independents$redConfig = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Independents$redSystem = A2($author$project$DnDList$create, $author$project$Introduction$Independents$redConfig, $author$project$Introduction$Independents$RedMsg); -var $author$project$Introduction$Independents$initialModel = {Y: $author$project$Introduction$Independents$blueSystem.dj, an: $author$project$Introduction$Independents$blueData, aj: $author$project$Introduction$Independents$redSystem.dj, aw: $author$project$Introduction$Independents$redData}; +var $author$project$Introduction$Independents$redConfig = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Independents$redSystem = A2($author$project$DnDList$create, $author$project$Introduction$Independents$RedMsg, $author$project$Introduction$Independents$redConfig); +var $author$project$Introduction$Independents$initialModel = {W: $author$project$Introduction$Independents$blueSystem.b0, am: $author$project$Introduction$Independents$blueData, ag: $author$project$Introduction$Independents$redSystem.b0, ax: $author$project$Introduction$Independents$redData}; var $author$project$Introduction$Keyed$data = A2( $elm$core$List$map, function (v) { @@ -9065,46 +9699,25 @@ var $author$project$Introduction$Keyed$data = A2( }, _List_fromArray( ['A', 'B', 'C', 'D'])); -var $author$project$Introduction$Keyed$MyMsg = $elm$core$Basics$identity; -var $author$project$Introduction$Keyed$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Keyed$system = A2($author$project$DnDList$create, $author$project$Introduction$Keyed$config, $elm$core$Basics$identity); -var $author$project$Introduction$Keyed$initialModel = {aa: $author$project$Introduction$Keyed$system.dj, au: $author$project$Introduction$Keyed$data}; +var $author$project$Introduction$Keyed$DnDMsg = $elm$core$Basics$identity; +var $author$project$Introduction$Keyed$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Keyed$system = A2($author$project$DnDList$create, $elm$core$Basics$identity, $author$project$Introduction$Keyed$config); +var $author$project$Introduction$Keyed$initialModel = {Z: $author$project$Introduction$Keyed$system.b0, av: $author$project$Introduction$Keyed$data}; var $author$project$Introduction$Margins$data = _List_fromArray( ['A', 'B', 'C', 'D']); -var $author$project$Introduction$Margins$MyMsg = $elm$core$Basics$identity; -var $author$project$Introduction$Margins$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Margins$system = A2($author$project$DnDList$create, $author$project$Introduction$Margins$config, $elm$core$Basics$identity); -var $author$project$Introduction$Margins$initialModel = {aa: $author$project$Introduction$Margins$system.dj, au: $author$project$Introduction$Margins$data}; -var $author$project$Introduction$Masonry$MyMsg = function (a) { +var $author$project$Introduction$Margins$DnDMsg = $elm$core$Basics$identity; +var $author$project$Introduction$Margins$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Margins$system = A2($author$project$DnDList$create, $elm$core$Basics$identity, $author$project$Introduction$Margins$config); +var $author$project$Introduction$Margins$initialModel = {Z: $author$project$Introduction$Margins$system.b0, av: $author$project$Introduction$Margins$data}; +var $author$project$Introduction$Masonry$DnDMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Introduction$Masonry$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Masonry$system = A2($author$project$DnDList$create, $author$project$Introduction$Masonry$config, $author$project$Introduction$Masonry$MyMsg); -var $author$project$Introduction$Masonry$initialModel = {aa: $author$project$Introduction$Masonry$system.dj, au: _List_Nil}; +var $author$project$Introduction$Masonry$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Masonry$system = A2($author$project$DnDList$create, $author$project$Introduction$Masonry$DnDMsg, $author$project$Introduction$Masonry$config); +var $author$project$Introduction$Masonry$initialModel = {Z: $author$project$Introduction$Masonry$system.b0, av: _List_Nil}; var $author$project$Introduction$Resize$blue = '#0696c5'; var $author$project$Introduction$Resize$green = '#768402'; var $author$project$Introduction$Resize$orange = '#e9513e'; @@ -9112,59 +9725,59 @@ var $author$project$Introduction$Resize$pink = '#c151a7'; var $author$project$Introduction$Resize$yellow = '#efa500'; var $author$project$Introduction$Resize$data = _List_fromArray( [$author$project$Introduction$Resize$yellow, $author$project$Introduction$Resize$pink, $author$project$Introduction$Resize$blue, $author$project$Introduction$Resize$green, $author$project$Introduction$Resize$orange]); -var $author$project$Introduction$Resize$MyMsg = $elm$core$Basics$identity; -var $author$project$Introduction$Resize$config = { - cv: F3( - function (_v0, _v1, list) { - return list; - }), - dg: 0, - dk: 0, - ds: 3 -}; -var $author$project$Introduction$Resize$system = A2($author$project$DnDList$create, $author$project$Introduction$Resize$config, $elm$core$Basics$identity); -var $author$project$Introduction$Resize$initialModel = {ap: $author$project$Introduction$Resize$data, aa: $author$project$Introduction$Resize$system.dj}; -var $author$project$Introduction$Root$toExample = function (slug) { +var $author$project$Introduction$Resize$DnDMsg = $elm$core$Basics$identity; +var $author$project$Introduction$Resize$config = $author$project$DnDList$config( + {bp: 0, b2: 0, a9: 3}); +var $author$project$Introduction$Resize$system = A2( + $author$project$DnDList$create, + $elm$core$Basics$identity, + A2( + $author$project$DnDList$ghostProperties, + _List_fromArray( + ['position']), + $author$project$Introduction$Resize$config)); +var $author$project$Introduction$Resize$initialModel = {ao: $author$project$Introduction$Resize$data, Z: $author$project$Introduction$Resize$system.b0}; +var $author$project$Introduction$Parent$toExample = function (slug) { switch (slug) { case 'basic': - return $author$project$Introduction$Root$Basic($author$project$Introduction$Basic$initialModel); + return $author$project$Introduction$Parent$Basic($author$project$Introduction$Basic$initialModel); case 'basic-elm-ui': - return $author$project$Introduction$Root$BasicElmUI($author$project$Introduction$BasicElmUI$initialModel); + return $author$project$Introduction$Parent$BasicElmUI($author$project$Introduction$BasicElmUI$initialModel); case 'handle': - return $author$project$Introduction$Root$Handle($author$project$Introduction$Handle$initialModel); + return $author$project$Introduction$Parent$Handle($author$project$Introduction$Handle$initialModel); case 'keyed': - return $author$project$Introduction$Root$Keyed($author$project$Introduction$Keyed$initialModel); + return $author$project$Introduction$Parent$Keyed($author$project$Introduction$Keyed$initialModel); case 'margins': - return $author$project$Introduction$Root$Margins($author$project$Introduction$Margins$initialModel); + return $author$project$Introduction$Parent$Margins($author$project$Introduction$Margins$initialModel); case 'masonry': - return $author$project$Introduction$Root$Masonry($author$project$Introduction$Masonry$initialModel); + return $author$project$Introduction$Parent$Masonry($author$project$Introduction$Masonry$initialModel); case 'resize': - return $author$project$Introduction$Root$Resize($author$project$Introduction$Resize$initialModel); + return $author$project$Introduction$Parent$Resize($author$project$Introduction$Resize$initialModel); case 'independents': - return $author$project$Introduction$Root$Independents($author$project$Introduction$Independents$initialModel); + return $author$project$Introduction$Parent$Independents($author$project$Introduction$Independents$initialModel); case 'groups': - return $author$project$Introduction$Root$Groups($author$project$Introduction$Groups$initialModel); + return $author$project$Introduction$Parent$Groups($author$project$Introduction$Groups$initialModel); default: - return $author$project$Introduction$Root$Basic($author$project$Introduction$Basic$initialModel); + return $author$project$Introduction$Parent$Basic($author$project$Introduction$Basic$initialModel); } }; -var $author$project$Introduction$Root$init = function (slug) { +var $author$project$Introduction$Parent$init = function (slug) { return _Utils_Tuple2( - $author$project$Introduction$Root$toExample(slug), - $author$project$Introduction$Root$commands); + $author$project$Introduction$Parent$toExample(slug), + $author$project$Introduction$Parent$commands); }; var $elm$url$Url$Parser$Parser = $elm$core$Basics$identity; var $elm$url$Url$Parser$State = F5( function (visited, unvisited, params, frag, value) { - return {ad: frag, ah: params, U: unvisited, aB: value, al: visited}; + return {aa: frag, ae: params, U: unvisited, aC: value, ak: visited}; }); var $elm$url$Url$Parser$mapState = F2( function (func, _v0) { - var value = _v0.aB; - var frag = _v0.ad; - var params = _v0.ah; + var value = _v0.aC; + var frag = _v0.aa; + var params = _v0.ae; var unvisited = _v0.U; - var visited = _v0.al; + var visited = _v0.ak; return A5( $elm$url$Url$Parser$State, visited, @@ -9177,11 +9790,11 @@ var $elm$url$Url$Parser$map = F2( function (subValue, _v0) { var parseArg = _v0; return function (_v1) { - var value = _v1.aB; - var frag = _v1.ad; - var params = _v1.ah; + var value = _v1.aC; + var frag = _v1.aa; + var params = _v1.ae; var unvisited = _v1.U; - var visited = _v1.al; + var visited = _v1.ak; return A2( $elm$core$List$map, $elm$url$Url$Parser$mapState(value), @@ -9215,10 +9828,10 @@ var $elm$url$Url$Parser$getFirstMatch = function (states) { var rest = states.b; var _v1 = state.U; if (!_v1.b) { - return $elm$core$Maybe$Just(state.aB); + return $elm$core$Maybe$Just(state.aC); } else { if ((_v1.a === '') && (!_v1.b.b)) { - return $elm$core$Maybe$Just(state.aB); + return $elm$core$Maybe$Just(state.aC); } else { var $temp$states = rest; states = $temp$states; @@ -9267,37 +9880,6 @@ var $elm$url$Url$Parser$addToParametersHelp = F2( } }); var $elm$url$Url$percentDecode = _Url_percentDecode; -var $elm$core$Dict$get = F2( - function (targetKey, dict) { - get: - while (true) { - if (dict.$ === -2) { - return $elm$core$Maybe$Nothing; - } else { - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - var _v1 = A2($elm$core$Basics$compare, targetKey, key); - switch (_v1) { - case 0: - var $temp$targetKey = targetKey, - $temp$dict = left; - targetKey = $temp$targetKey; - dict = $temp$dict; - continue get; - case 1: - return $elm$core$Maybe$Just(value); - default: - var $temp$targetKey = targetKey, - $temp$dict = right; - targetKey = $temp$targetKey; - dict = $temp$dict; - continue get; - } - } - } - }); var $elm$core$Dict$getMin = function (dict) { getMin: while (true) { @@ -9719,19 +10301,19 @@ var $elm$url$Url$Parser$parse = F2( A5( $elm$url$Url$Parser$State, _List_Nil, - $elm$url$Url$Parser$preparePath(url.z), - $elm$url$Url$Parser$prepareQuery(url.b_), - url.bE, + $elm$url$Url$Parser$preparePath(url.A), + $elm$url$Url$Parser$prepareQuery(url.ce), + url.bQ, $elm$core$Basics$identity))); }); var $author$project$Path$rootPath = 'dnd-list'; var $elm$url$Url$Parser$s = function (str) { return function (_v0) { - var value = _v0.aB; - var frag = _v0.ad; - var params = _v0.ah; + var value = _v0.aC; + var frag = _v0.aa; + var params = _v0.ae; var unvisited = _v0.U; - var visited = _v0.al; + var visited = _v0.ak; if (!unvisited.b) { return _List_Nil; } else { @@ -9764,11 +10346,11 @@ var $elm$url$Url$Parser$slash = F2( var $elm$url$Url$Parser$custom = F2( function (tipe, stringToSomething) { return function (_v0) { - var value = _v0.aB; - var frag = _v0.ad; - var params = _v0.ah; + var value = _v0.aC; + var frag = _v0.aa; + var params = _v0.ae; var unvisited = _v0.U; - var visited = _v0.al; + var visited = _v0.ak; if (!unvisited.b) { return _List_Nil; } else { @@ -9794,10 +10376,10 @@ var $elm$url$Url$Parser$custom = F2( }; }); var $author$project$Main$slug_ = A2($elm$url$Url$Parser$custom, 'SLUG', $elm$core$Maybe$Just); -var $author$project$Main$Config = function (a) { +var $author$project$Main$DnDList = function (a) { return {$: 3, a: a}; }; -var $author$project$Main$ConfigMsg = function (a) { +var $author$project$Main$DnDListMsg = function (a) { return {$: 5, a: a}; }; var $author$project$Main$stepConfig = F2( @@ -9808,14 +10390,14 @@ var $author$project$Main$stepConfig = F2( _Utils_update( model, { - s: $author$project$Main$Config(mo) + u: $author$project$Main$DnDList(mo) }), - A2($elm$core$Platform$Cmd$map, $author$project$Main$ConfigMsg, cmds)); + A2($elm$core$Platform$Cmd$map, $author$project$Main$DnDListMsg, cmds)); }); -var $author$project$Main$ConfigGroups = function (a) { +var $author$project$Main$DnDListGroups = function (a) { return {$: 4, a: a}; }; -var $author$project$Main$ConfigGroupsMsg = function (a) { +var $author$project$Main$DnDListGroupsMsg = function (a) { return {$: 6, a: a}; }; var $author$project$Main$stepConfigGroups = F2( @@ -9826,9 +10408,9 @@ var $author$project$Main$stepConfigGroups = F2( _Utils_update( model, { - s: $author$project$Main$ConfigGroups(mo) + u: $author$project$Main$DnDListGroups(mo) }), - A2($elm$core$Platform$Cmd$map, $author$project$Main$ConfigGroupsMsg, cmds)); + A2($elm$core$Platform$Cmd$map, $author$project$Main$DnDListGroupsMsg, cmds)); }); var $author$project$Main$Gallery = function (a) { return {$: 5, a: a}; @@ -9844,7 +10426,7 @@ var $author$project$Main$stepGallery = F2( _Utils_update( model, { - s: $author$project$Main$Gallery(mo) + u: $author$project$Main$Gallery(mo) }), A2($elm$core$Platform$Cmd$map, $author$project$Main$GalleryMsg, cmds)); }); @@ -9862,7 +10444,7 @@ var $author$project$Main$stepIntroduction = F2( _Utils_update( model, { - s: $author$project$Main$Introduction(mo) + u: $author$project$Main$Introduction(mo) }), A2($elm$core$Platform$Cmd$map, $author$project$Main$IntroductionMsg, cmds)); }); @@ -9880,14 +10462,14 @@ var $author$project$Main$stepUrl = F2( A2( $author$project$Main$stepGallery, model, - $author$project$Gallery$Root$init('hanoi')), + $author$project$Gallery$Parent$init('hanoi')), $elm$url$Url$Parser$top), A2( $elm$url$Url$Parser$map, A2( $author$project$Main$stepGallery, model, - $author$project$Gallery$Root$init('hanoi')), + $author$project$Gallery$Parent$init('hanoi')), $elm$url$Url$Parser$s($author$project$Path$rootPath)), A2( $elm$url$Url$Parser$map, @@ -9895,7 +10477,7 @@ var $author$project$Main$stepUrl = F2( return A2( $author$project$Main$stepIntroduction, model, - $author$project$Introduction$Root$init(slug)); + $author$project$Introduction$Parent$init(slug)); }, A2( $elm$url$Url$Parser$slash, @@ -9910,14 +10492,14 @@ var $author$project$Main$stepUrl = F2( return A2( $author$project$Main$stepConfig, model, - $author$project$Config$Root$init(slug)); + $author$project$DnDList$Parent$init(slug)); }, A2( $elm$url$Url$Parser$slash, $elm$url$Url$Parser$s($author$project$Path$rootPath), A2( $elm$url$Url$Parser$slash, - $elm$url$Url$Parser$s('config'), + $elm$url$Url$Parser$s('DnDList'), $author$project$Main$slug_))), A2( $elm$url$Url$Parser$map, @@ -9925,14 +10507,14 @@ var $author$project$Main$stepUrl = F2( return A2( $author$project$Main$stepConfigGroups, model, - $author$project$ConfigGroups$Root$init(slug)); + $author$project$DnDListGroups$Parent$init(slug)); }, A2( $elm$url$Url$Parser$slash, $elm$url$Url$Parser$s($author$project$Path$rootPath), A2( $elm$url$Url$Parser$slash, - $elm$url$Url$Parser$s('config-groups'), + $elm$url$Url$Parser$s('DnDListGroups'), $author$project$Main$slug_))), A2( $elm$url$Url$Parser$map, @@ -9940,7 +10522,7 @@ var $author$project$Main$stepUrl = F2( return A2( $author$project$Main$stepGallery, model, - $author$project$Gallery$Root$init(slug)); + $author$project$Gallery$Parent$init(slug)); }, A2( $elm$url$Url$Parser$slash, @@ -9955,7 +10537,7 @@ var $author$project$Main$stepUrl = F2( return _Utils_Tuple2( _Utils_update( model, - {s: $author$project$Main$NotFound}), + {u: $author$project$Main$NotFound}), $elm$core$Platform$Cmd$none); } else { var answer = _v0.a; @@ -9982,11 +10564,11 @@ var $elm$url$Url$Builder$absolute = F2( return '/' + (A2($elm$core$String$join, '/', pathSegments) + $elm$url$Url$Builder$toQuery(parameters)); }); var $author$project$Main$toPath = function (url) { - return (_Utils_eq(url.z, '/' + $author$project$Path$rootPath) || _Utils_eq(url.z, '/' + ($author$project$Path$rootPath + '/'))) ? A2( + return (_Utils_eq(url.A, '/' + $author$project$Path$rootPath) || _Utils_eq(url.A, '/' + ($author$project$Path$rootPath + '/'))) ? A2( $elm$url$Url$Builder$absolute, _List_fromArray( [$author$project$Path$rootPath, 'gallery', 'hanoi']), - _List_Nil) : url.z; + _List_Nil) : url.A; }; var $author$project$Main$init = F3( function (flags, url, key) { @@ -9994,61 +10576,97 @@ var $author$project$Main$init = F3( $author$project$Main$stepUrl, url, { - s: $author$project$Main$NotFound, - bf: key, - z: $author$project$Main$toPath(url) + u: $author$project$Main$NotFound, + bo: key, + A: $author$project$Main$toPath(url) }); }); var $author$project$Main$HomeMsg = function (a) { return {$: 3, a: a}; }; var $elm$core$Platform$Sub$map = _Platform_map; -var $author$project$Config$Root$MovementMsg = function (a) { +var $author$project$DnDList$Parent$HookCommandsMsg = function (a) { + return {$: 3, a: a}; +}; +var $author$project$DnDList$Parent$MovementMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$Root$OperationsOnDragMsg = function (a) { +var $author$project$DnDList$Parent$OperationsOnDragMsg = function (a) { + return {$: 1, a: a}; +}; +var $author$project$DnDList$Parent$OperationsOnDropMsg = function (a) { + return {$: 2, a: a}; +}; +var $author$project$DnDList$HookCommands$Parent$DetectDropMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$Root$OperationsOnDropMsg = function (a) { +var $author$project$DnDList$HookCommands$Parent$DetectReorderMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$Movement$Root$FreeOnDragMsg = function (a) { +var $author$project$DnDList$HookCommands$DetectDrop$subscriptions = function (model) { + return $author$project$DnDList$HookCommands$DetectDrop$system.cm(model.Z); +}; +var $author$project$DnDList$HookCommands$DetectReorder$subscriptions = function (model) { + return $author$project$DnDList$HookCommands$DetectReorder$system.cm(model.Z); +}; +var $author$project$DnDList$HookCommands$Parent$subscriptions = function (model) { + return $elm$core$Platform$Sub$batch( + A2( + $elm$core$List$map, + function (example) { + if (!example.$) { + var mo = example.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDList$HookCommands$Parent$DetectDropMsg, + $author$project$DnDList$HookCommands$DetectDrop$subscriptions(mo)); + } else { + var mo = example.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDList$HookCommands$Parent$DetectReorderMsg, + $author$project$DnDList$HookCommands$DetectReorder$subscriptions(mo)); + } + }, + model.at)); +}; +var $author$project$DnDList$Movement$Parent$FreeOnDragMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$Movement$Root$FreeOnDropMsg = function (a) { +var $author$project$DnDList$Movement$Parent$FreeOnDropMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$Movement$Root$HorizontalOnDragMsg = function (a) { +var $author$project$DnDList$Movement$Parent$HorizontalOnDragMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$Config$Movement$Root$HorizontalOnDropMsg = function (a) { +var $author$project$DnDList$Movement$Parent$HorizontalOnDropMsg = function (a) { return {$: 4, a: a}; }; -var $author$project$Config$Movement$Root$VerticalOnDragMsg = function (a) { +var $author$project$DnDList$Movement$Parent$VerticalOnDragMsg = function (a) { return {$: 5, a: a}; }; -var $author$project$Config$Movement$Root$VerticalOnDropMsg = function (a) { +var $author$project$DnDList$Movement$Parent$VerticalOnDropMsg = function (a) { return {$: 6, a: a}; }; -var $author$project$Config$Movement$FreeOnDrag$subscriptions = function (model) { - return $author$project$Config$Movement$FreeOnDrag$system.b5(model.aa); +var $author$project$DnDList$Movement$FreeOnDrag$subscriptions = function (model) { + return $author$project$DnDList$Movement$FreeOnDrag$system.cm(model.Z); }; -var $author$project$Config$Movement$FreeOnDrop$subscriptions = function (model) { - return $author$project$Config$Movement$FreeOnDrop$system.b5(model.aa); +var $author$project$DnDList$Movement$FreeOnDrop$subscriptions = function (model) { + return $author$project$DnDList$Movement$FreeOnDrop$system.cm(model.Z); }; -var $author$project$Config$Movement$HorizontalOnDrag$subscriptions = function (model) { - return $author$project$Config$Movement$HorizontalOnDrag$system.b5(model.aa); +var $author$project$DnDList$Movement$HorizontalOnDrag$subscriptions = function (model) { + return $author$project$DnDList$Movement$HorizontalOnDrag$system.cm(model.Z); }; -var $author$project$Config$Movement$HorizontalOnDrop$subscriptions = function (model) { - return $author$project$Config$Movement$HorizontalOnDrop$system.b5(model.aa); +var $author$project$DnDList$Movement$HorizontalOnDrop$subscriptions = function (model) { + return $author$project$DnDList$Movement$HorizontalOnDrop$system.cm(model.Z); }; -var $author$project$Config$Movement$VerticalOnDrag$subscriptions = function (model) { - return $author$project$Config$Movement$VerticalOnDrag$system.b5(model.aa); +var $author$project$DnDList$Movement$VerticalOnDrag$subscriptions = function (model) { + return $author$project$DnDList$Movement$VerticalOnDrag$system.cm(model.Z); }; -var $author$project$Config$Movement$VerticalOnDrop$subscriptions = function (model) { - return $author$project$Config$Movement$VerticalOnDrop$system.b5(model.aa); +var $author$project$DnDList$Movement$VerticalOnDrop$subscriptions = function (model) { + return $author$project$DnDList$Movement$VerticalOnDrop$system.cm(model.Z); }; -var $author$project$Config$Movement$Root$subscriptions = function (model) { +var $author$project$DnDList$Movement$Parent$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( A2( $elm$core$List$map, @@ -10058,73 +10676,73 @@ var $author$project$Config$Movement$Root$subscriptions = function (model) { var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Movement$Root$FreeOnDragMsg, - $author$project$Config$Movement$FreeOnDrag$subscriptions(mo)); + $author$project$DnDList$Movement$Parent$FreeOnDragMsg, + $author$project$DnDList$Movement$FreeOnDrag$subscriptions(mo)); case 1: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Movement$Root$FreeOnDropMsg, - $author$project$Config$Movement$FreeOnDrop$subscriptions(mo)); + $author$project$DnDList$Movement$Parent$FreeOnDropMsg, + $author$project$DnDList$Movement$FreeOnDrop$subscriptions(mo)); case 2: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Movement$Root$HorizontalOnDragMsg, - $author$project$Config$Movement$HorizontalOnDrag$subscriptions(mo)); + $author$project$DnDList$Movement$Parent$HorizontalOnDragMsg, + $author$project$DnDList$Movement$HorizontalOnDrag$subscriptions(mo)); case 3: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Movement$Root$HorizontalOnDropMsg, - $author$project$Config$Movement$HorizontalOnDrop$subscriptions(mo)); + $author$project$DnDList$Movement$Parent$HorizontalOnDropMsg, + $author$project$DnDList$Movement$HorizontalOnDrop$subscriptions(mo)); case 4: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Movement$Root$VerticalOnDragMsg, - $author$project$Config$Movement$VerticalOnDrag$subscriptions(mo)); + $author$project$DnDList$Movement$Parent$VerticalOnDragMsg, + $author$project$DnDList$Movement$VerticalOnDrag$subscriptions(mo)); default: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Movement$Root$VerticalOnDropMsg, - $author$project$Config$Movement$VerticalOnDrop$subscriptions(mo)); + $author$project$DnDList$Movement$Parent$VerticalOnDropMsg, + $author$project$DnDList$Movement$VerticalOnDrop$subscriptions(mo)); } }, - model.Q)); + model.at)); }; -var $author$project$Config$OperationsOnDrag$Root$InsertAfterMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$InsertAfterMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$InsertBeforeMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$InsertBeforeMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$RotateMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$RotateMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$SwapMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$SwapMsg = function (a) { return {$: 4, a: a}; }; -var $author$project$Config$OperationsOnDrag$Root$UnalteredMsg = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$UnalteredMsg = function (a) { return {$: 5, a: a}; }; -var $author$project$Config$OperationsOnDrag$InsertAfter$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrag$InsertAfter$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrag$InsertAfter$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrag$InsertAfter$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrag$InsertBefore$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrag$InsertBefore$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrag$InsertBefore$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrag$InsertBefore$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrag$Rotate$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrag$Rotate$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrag$Rotate$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrag$Rotate$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrag$Swap$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrag$Swap$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrag$Swap$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrag$Swap$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrag$Unaltered$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrag$Unaltered$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrag$Unaltered$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrag$Unaltered$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrag$Root$subscriptions = function (model) { +var $author$project$DnDList$OperationsOnDrag$Parent$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( A2( $elm$core$List$map, @@ -10134,67 +10752,67 @@ var $author$project$Config$OperationsOnDrag$Root$subscriptions = function (model var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrag$Root$InsertAfterMsg, - $author$project$Config$OperationsOnDrag$InsertAfter$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$InsertAfterMsg, + $author$project$DnDList$OperationsOnDrag$InsertAfter$subscriptions(mo)); case 1: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrag$Root$InsertBeforeMsg, - $author$project$Config$OperationsOnDrag$InsertBefore$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$InsertBeforeMsg, + $author$project$DnDList$OperationsOnDrag$InsertBefore$subscriptions(mo)); case 2: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrag$Root$RotateMsg, - $author$project$Config$OperationsOnDrag$Rotate$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$RotateMsg, + $author$project$DnDList$OperationsOnDrag$Rotate$subscriptions(mo)); case 3: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrag$Root$SwapMsg, - $author$project$Config$OperationsOnDrag$Swap$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$SwapMsg, + $author$project$DnDList$OperationsOnDrag$Swap$subscriptions(mo)); default: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrag$Root$UnalteredMsg, - $author$project$Config$OperationsOnDrag$Unaltered$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$UnalteredMsg, + $author$project$DnDList$OperationsOnDrag$Unaltered$subscriptions(mo)); } }, - model.Q)); + model.at)); }; -var $author$project$Config$OperationsOnDrop$Root$InsertAfterMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$InsertAfterMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$InsertBeforeMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$InsertBeforeMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$RotateMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$RotateMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$SwapMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$SwapMsg = function (a) { return {$: 4, a: a}; }; -var $author$project$Config$OperationsOnDrop$Root$UnalteredMsg = function (a) { +var $author$project$DnDList$OperationsOnDrop$Parent$UnalteredMsg = function (a) { return {$: 5, a: a}; }; -var $author$project$Config$OperationsOnDrop$InsertAfter$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrop$InsertAfter$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrop$InsertAfter$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrop$InsertAfter$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrop$InsertBefore$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrop$InsertBefore$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrop$InsertBefore$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrop$InsertBefore$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrop$Rotate$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrop$Rotate$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrop$Rotate$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrop$Rotate$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrop$Swap$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrop$Swap$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrop$Swap$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrop$Swap$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrop$Unaltered$subscriptions = function (model) { - return $author$project$Config$OperationsOnDrop$Unaltered$system.b5(model.aa); +var $author$project$DnDList$OperationsOnDrop$Unaltered$subscriptions = function (model) { + return $author$project$DnDList$OperationsOnDrop$Unaltered$system.cm(model.Z); }; -var $author$project$Config$OperationsOnDrop$Root$subscriptions = function (model) { +var $author$project$DnDList$OperationsOnDrop$Parent$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( A2( $elm$core$List$map, @@ -10204,89 +10822,131 @@ var $author$project$Config$OperationsOnDrop$Root$subscriptions = function (model var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrop$Root$InsertAfterMsg, - $author$project$Config$OperationsOnDrop$InsertAfter$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrop$Parent$InsertAfterMsg, + $author$project$DnDList$OperationsOnDrop$InsertAfter$subscriptions(mo)); case 1: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrop$Root$InsertBeforeMsg, - $author$project$Config$OperationsOnDrop$InsertBefore$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrop$Parent$InsertBeforeMsg, + $author$project$DnDList$OperationsOnDrop$InsertBefore$subscriptions(mo)); case 2: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrop$Root$RotateMsg, - $author$project$Config$OperationsOnDrop$Rotate$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrop$Parent$RotateMsg, + $author$project$DnDList$OperationsOnDrop$Rotate$subscriptions(mo)); case 3: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrop$Root$SwapMsg, - $author$project$Config$OperationsOnDrop$Swap$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrop$Parent$SwapMsg, + $author$project$DnDList$OperationsOnDrop$Swap$subscriptions(mo)); default: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$OperationsOnDrop$Root$UnalteredMsg, - $author$project$Config$OperationsOnDrop$Unaltered$subscriptions(mo)); + $author$project$DnDList$OperationsOnDrop$Parent$UnalteredMsg, + $author$project$DnDList$OperationsOnDrop$Unaltered$subscriptions(mo)); } }, - model.Q)); + model.at)); }; -var $author$project$Config$Root$subscriptions = function (model) { +var $author$project$DnDList$Parent$subscriptions = function (model) { switch (model.$) { case 0: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Root$MovementMsg, - $author$project$Config$Movement$Root$subscriptions(mo)); + $author$project$DnDList$Parent$MovementMsg, + $author$project$DnDList$Movement$Parent$subscriptions(mo)); case 1: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Root$OperationsOnDragMsg, - $author$project$Config$OperationsOnDrag$Root$subscriptions(mo)); + $author$project$DnDList$Parent$OperationsOnDragMsg, + $author$project$DnDList$OperationsOnDrag$Parent$subscriptions(mo)); + case 2: + var mo = model.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDList$Parent$OperationsOnDropMsg, + $author$project$DnDList$OperationsOnDrop$Parent$subscriptions(mo)); default: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Config$Root$OperationsOnDropMsg, - $author$project$Config$OperationsOnDrop$Root$subscriptions(mo)); + $author$project$DnDList$Parent$HookCommandsMsg, + $author$project$DnDList$HookCommands$Parent$subscriptions(mo)); } }; -var $author$project$ConfigGroups$Root$OperationsOnDragMsg = function (a) { +var $author$project$DnDListGroups$Parent$HookCommandsMsg = function (a) { + return {$: 2, a: a}; +}; +var $author$project$DnDListGroups$Parent$OperationsOnDragMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$Root$OperationsOnDropMsg = function (a) { +var $author$project$DnDListGroups$Parent$OperationsOnDropMsg = function (a) { + return {$: 1, a: a}; +}; +var $author$project$DnDListGroups$HookCommands$Parent$DetectDropMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfterMsg = function (a) { +var $author$project$DnDListGroups$HookCommands$Parent$DetectReorderMsg = function (a) { + return {$: 2, a: a}; +}; +var $author$project$DnDListGroups$HookCommands$DetectDrop$subscriptions = function (model) { + return $author$project$DnDListGroups$HookCommands$DetectDrop$system.cm(model.Z); +}; +var $author$project$DnDListGroups$HookCommands$DetectReorder$subscriptions = function (model) { + return $author$project$DnDListGroups$HookCommands$DetectReorder$system.cm(model.Z); +}; +var $author$project$DnDListGroups$HookCommands$Parent$subscriptions = function (model) { + return $elm$core$Platform$Sub$batch( + A2( + $elm$core$List$map, + function (example) { + if (!example.$) { + var mo = example.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDListGroups$HookCommands$Parent$DetectDropMsg, + $author$project$DnDListGroups$HookCommands$DetectDrop$subscriptions(mo)); + } else { + var mo = example.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDListGroups$HookCommands$Parent$DetectReorderMsg, + $author$project$DnDListGroups$HookCommands$DetectReorder$subscriptions(mo)); + } + }, + model.at)); +}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfterMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBeforeMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBeforeMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$RotateMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$RotateMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$SwapMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$SwapMsg = function (a) { return {$: 4, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrag$Rotate$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrag$Rotate$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrag$Swap$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrag$Swap$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrag$Swap$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$subscriptions = function (model) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( A2( $elm$core$List$map, @@ -10296,55 +10956,55 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$subscriptions = function var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfterMsg, - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfterMsg, + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$subscriptions(mo)); case 1: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBeforeMsg, - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBeforeMsg, + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$subscriptions(mo)); case 2: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$RotateMsg, - $author$project$ConfigGroups$OperationsOnDrag$Rotate$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$RotateMsg, + $author$project$DnDListGroups$OperationsOnDrag$Rotate$subscriptions(mo)); default: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$SwapMsg, - $author$project$ConfigGroups$OperationsOnDrag$Swap$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$SwapMsg, + $author$project$DnDListGroups$OperationsOnDrag$Swap$subscriptions(mo)); } }, - model.Q)); + model.at)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfterMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfterMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBeforeMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBeforeMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$RotateMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$RotateMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$SwapMsg = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$SwapMsg = function (a) { return {$: 4, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrop$Rotate$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrop$Rotate$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$subscriptions = function (model) { - return $author$project$ConfigGroups$OperationsOnDrop$Swap$system.b5(model.aa); +var $author$project$DnDListGroups$OperationsOnDrop$Swap$subscriptions = function (model) { + return $author$project$DnDListGroups$OperationsOnDrop$Swap$system.cm(model.Z); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$subscriptions = function (model) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( A2( $elm$core$List$map, @@ -10354,242 +11014,249 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$subscriptions = function var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfterMsg, - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfterMsg, + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$subscriptions(mo)); case 1: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBeforeMsg, - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBeforeMsg, + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$subscriptions(mo)); case 2: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$RotateMsg, - $author$project$ConfigGroups$OperationsOnDrop$Rotate$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$RotateMsg, + $author$project$DnDListGroups$OperationsOnDrop$Rotate$subscriptions(mo)); default: var mo = example.a; return A2( $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$SwapMsg, - $author$project$ConfigGroups$OperationsOnDrop$Swap$subscriptions(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$SwapMsg, + $author$project$DnDListGroups$OperationsOnDrop$Swap$subscriptions(mo)); } }, - model.Q)); + model.at)); }; -var $author$project$ConfigGroups$Root$subscriptions = function (model) { - if (!model.$) { - var mo = model.a; - return A2( - $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$Root$OperationsOnDragMsg, - $author$project$ConfigGroups$OperationsOnDrag$Root$subscriptions(mo)); - } else { - var mo = model.a; - return A2( - $elm$core$Platform$Sub$map, - $author$project$ConfigGroups$Root$OperationsOnDropMsg, - $author$project$ConfigGroups$OperationsOnDrop$Root$subscriptions(mo)); +var $author$project$DnDListGroups$Parent$subscriptions = function (model) { + switch (model.$) { + case 0: + var mo = model.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDListGroups$Parent$OperationsOnDragMsg, + $author$project$DnDListGroups$OperationsOnDrag$Parent$subscriptions(mo)); + case 1: + var mo = model.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDListGroups$Parent$OperationsOnDropMsg, + $author$project$DnDListGroups$OperationsOnDrop$Parent$subscriptions(mo)); + default: + var mo = model.a; + return A2( + $elm$core$Platform$Sub$map, + $author$project$DnDListGroups$Parent$HookCommandsMsg, + $author$project$DnDListGroups$HookCommands$Parent$subscriptions(mo)); } }; -var $author$project$Gallery$Root$HanoiMsg = function (a) { +var $author$project$Gallery$Parent$HanoiMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Gallery$Root$KnightMsg = function (a) { +var $author$project$Gallery$Parent$KnightMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$Gallery$Root$ShapesMsg = function (a) { +var $author$project$Gallery$Parent$ShapesMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$Gallery$Root$TaskBoardMsg = function (a) { +var $author$project$Gallery$Parent$TaskBoardMsg = function (a) { return {$: 5, a: a}; }; -var $author$project$Gallery$Root$TryOnMsg = function (a) { +var $author$project$Gallery$Parent$TryOnMsg = function (a) { return {$: 4, a: a}; }; var $author$project$Gallery$Hanoi$subscriptions = function (model) { - return $author$project$Gallery$Hanoi$system.b5(model.aa); + return $author$project$Gallery$Hanoi$system.cm(model.Z); }; var $author$project$Gallery$Knight$subscriptions = function (model) { - return $author$project$Gallery$Knight$system.b5(model.aa); + return $author$project$Gallery$Knight$system.cm(model.Z); }; var $author$project$Gallery$Puzzle$subscriptions = function (model) { - return $author$project$Gallery$Puzzle$system.b5(model.aa); + return $author$project$Gallery$Puzzle$system.cm(model.Z); }; var $author$project$Gallery$Shapes$subscriptions = function (model) { - return $author$project$Gallery$Shapes$system.b5(model.aa); + return $author$project$Gallery$Shapes$system.cm(model.Z); }; var $author$project$Gallery$TaskBoard$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( _List_fromArray( [ - $author$project$Gallery$TaskBoard$cardSystem.b5(model.K), - $author$project$Gallery$TaskBoard$columnSystem.b5(model.M) + $author$project$Gallery$TaskBoard$cardSystem.cm(model.K), + $author$project$Gallery$TaskBoard$columnSystem.cm(model.M) ])); }; var $author$project$Gallery$TryOn$subscriptions = function (model) { - return $author$project$Gallery$TryOn$system.b5(model.aa); + return $author$project$Gallery$TryOn$system.cm(model.Z); }; -var $author$project$Gallery$Root$subscriptions = function (model) { +var $author$project$Gallery$Parent$subscriptions = function (model) { switch (model.$) { case 0: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Gallery$Root$HanoiMsg, + $author$project$Gallery$Parent$HanoiMsg, $author$project$Gallery$Hanoi$subscriptions(mo)); case 1: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Gallery$Root$PuzzleMsg, + $author$project$Gallery$Parent$PuzzleMsg, $author$project$Gallery$Puzzle$subscriptions(mo)); case 2: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Gallery$Root$ShapesMsg, + $author$project$Gallery$Parent$ShapesMsg, $author$project$Gallery$Shapes$subscriptions(mo)); case 3: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Gallery$Root$KnightMsg, + $author$project$Gallery$Parent$KnightMsg, $author$project$Gallery$Knight$subscriptions(mo)); case 4: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Gallery$Root$TryOnMsg, + $author$project$Gallery$Parent$TryOnMsg, $author$project$Gallery$TryOn$subscriptions(mo)); default: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Gallery$Root$TaskBoardMsg, + $author$project$Gallery$Parent$TaskBoardMsg, $author$project$Gallery$TaskBoard$subscriptions(mo)); } }; var $author$project$Home$subscriptions = function (model) { return $elm$core$Platform$Sub$none; }; -var $author$project$Introduction$Root$BasicElmUIMsg = function (a) { +var $author$project$Introduction$Parent$BasicElmUIMsg = function (a) { return {$: 1, a: a}; }; -var $author$project$Introduction$Root$BasicMsg = function (a) { +var $author$project$Introduction$Parent$BasicMsg = function (a) { return {$: 0, a: a}; }; -var $author$project$Introduction$Root$GroupsMsg = function (a) { +var $author$project$Introduction$Parent$GroupsMsg = function (a) { return {$: 8, a: a}; }; -var $author$project$Introduction$Root$HandleMsg = function (a) { +var $author$project$Introduction$Parent$HandleMsg = function (a) { return {$: 2, a: a}; }; -var $author$project$Introduction$Root$IndependentsMsg = function (a) { +var $author$project$Introduction$Parent$IndependentsMsg = function (a) { return {$: 7, a: a}; }; -var $author$project$Introduction$Root$KeyedMsg = function (a) { +var $author$project$Introduction$Parent$KeyedMsg = function (a) { return {$: 3, a: a}; }; -var $author$project$Introduction$Root$MarginsMsg = function (a) { +var $author$project$Introduction$Parent$MarginsMsg = function (a) { return {$: 4, a: a}; }; -var $author$project$Introduction$Root$ResizeMsg = function (a) { +var $author$project$Introduction$Parent$ResizeMsg = function (a) { return {$: 6, a: a}; }; var $author$project$Introduction$Basic$subscriptions = function (model) { - return $author$project$Introduction$Basic$system.b5(model.aa); + return $author$project$Introduction$Basic$system.cm(model.Z); }; var $author$project$Introduction$BasicElmUI$subscriptions = function (model) { - return $author$project$Introduction$BasicElmUI$system.b5(model.aa); + return $author$project$Introduction$BasicElmUI$system.cm(model.Z); }; var $author$project$Introduction$Groups$subscriptions = function (model) { - return $author$project$Introduction$Groups$system.b5(model.aa); + return $author$project$Introduction$Groups$system.cm(model.Z); }; var $author$project$Introduction$Handle$subscriptions = function (model) { - return $author$project$Introduction$Handle$system.b5(model.aa); + return $author$project$Introduction$Handle$system.cm(model.Z); }; var $author$project$Introduction$Independents$subscriptions = function (model) { return $elm$core$Platform$Sub$batch( _List_fromArray( [ - $author$project$Introduction$Independents$redSystem.b5(model.aj), - $author$project$Introduction$Independents$blueSystem.b5(model.Y) + $author$project$Introduction$Independents$redSystem.cm(model.ag), + $author$project$Introduction$Independents$blueSystem.cm(model.W) ])); }; var $author$project$Introduction$Keyed$subscriptions = function (model) { - return $author$project$Introduction$Keyed$system.b5(model.aa); + return $author$project$Introduction$Keyed$system.cm(model.Z); }; var $author$project$Introduction$Margins$subscriptions = function (model) { - return $author$project$Introduction$Margins$system.b5(model.aa); + return $author$project$Introduction$Margins$system.cm(model.Z); }; var $author$project$Introduction$Masonry$subscriptions = function (model) { - return $author$project$Introduction$Masonry$system.b5(model.aa); + return $author$project$Introduction$Masonry$system.cm(model.Z); }; var $author$project$Introduction$Resize$subscriptions = function (model) { - return $author$project$Introduction$Resize$system.b5(model.aa); + return $author$project$Introduction$Resize$system.cm(model.Z); }; -var $author$project$Introduction$Root$subscriptions = function (model) { +var $author$project$Introduction$Parent$subscriptions = function (model) { switch (model.$) { case 0: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$BasicMsg, + $author$project$Introduction$Parent$BasicMsg, $author$project$Introduction$Basic$subscriptions(mo)); case 1: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$BasicElmUIMsg, + $author$project$Introduction$Parent$BasicElmUIMsg, $author$project$Introduction$BasicElmUI$subscriptions(mo)); case 2: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$HandleMsg, + $author$project$Introduction$Parent$HandleMsg, $author$project$Introduction$Handle$subscriptions(mo)); case 3: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$KeyedMsg, + $author$project$Introduction$Parent$KeyedMsg, $author$project$Introduction$Keyed$subscriptions(mo)); case 4: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$MarginsMsg, + $author$project$Introduction$Parent$MarginsMsg, $author$project$Introduction$Margins$subscriptions(mo)); case 5: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$MasonryMsg, + $author$project$Introduction$Parent$MasonryMsg, $author$project$Introduction$Masonry$subscriptions(mo)); case 6: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$ResizeMsg, + $author$project$Introduction$Parent$ResizeMsg, $author$project$Introduction$Resize$subscriptions(mo)); case 7: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$IndependentsMsg, + $author$project$Introduction$Parent$IndependentsMsg, $author$project$Introduction$Independents$subscriptions(mo)); default: var mo = model.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Introduction$Root$GroupsMsg, + $author$project$Introduction$Parent$GroupsMsg, $author$project$Introduction$Groups$subscriptions(mo)); } }; var $author$project$Main$subscriptions = function (model) { - var _v0 = model.s; + var _v0 = model.u; switch (_v0.$) { case 0: return $elm$core$Platform$Sub$none; @@ -10604,25 +11271,25 @@ var $author$project$Main$subscriptions = function (model) { return A2( $elm$core$Platform$Sub$map, $author$project$Main$IntroductionMsg, - $author$project$Introduction$Root$subscriptions(mo)); + $author$project$Introduction$Parent$subscriptions(mo)); case 3: var mo = _v0.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Main$ConfigMsg, - $author$project$Config$Root$subscriptions(mo)); + $author$project$Main$DnDListMsg, + $author$project$DnDList$Parent$subscriptions(mo)); case 4: var mo = _v0.a; return A2( $elm$core$Platform$Sub$map, - $author$project$Main$ConfigGroupsMsg, - $author$project$ConfigGroups$Root$subscriptions(mo)); + $author$project$Main$DnDListGroupsMsg, + $author$project$DnDListGroups$Parent$subscriptions(mo)); default: var mo = _v0.a; return A2( $elm$core$Platform$Sub$map, $author$project$Main$GalleryMsg, - $author$project$Gallery$Root$subscriptions(mo)); + $author$project$Gallery$Parent$subscriptions(mo)); } }; var $author$project$Main$NoOp = {$: 0}; @@ -10654,7 +11321,7 @@ var $author$project$Main$stepHome = F2( _Utils_update( model, { - s: $author$project$Main$Home(mo) + u: $author$project$Main$Home(mo) }), A2($elm$core$Platform$Cmd$map, $author$project$Main$HomeMsg, cmds)); }); @@ -10678,122 +11345,251 @@ var $elm$url$Url$addPrefixed = F3( _Utils_ap(prefix, segment)); } }); -var $elm$url$Url$toString = function (url) { - var http = function () { - var _v0 = url.bZ; - if (!_v0) { - return 'http://'; +var $elm$url$Url$toString = function (url) { + var http = function () { + var _v0 = url.cd; + if (!_v0) { + return 'http://'; + } else { + return 'https://'; + } + }(); + return A3( + $elm$url$Url$addPrefixed, + '#', + url.bQ, + A3( + $elm$url$Url$addPrefixed, + '?', + url.ce, + _Utils_ap( + A2( + $elm$url$Url$addPort, + url.ca, + _Utils_ap(http, url.bV)), + url.A))); +}; +var $author$project$DnDList$Parent$stepHookCommands = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDList$Parent$HookCommands(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Parent$HookCommandsMsg, cmds)); +}; +var $author$project$DnDList$Parent$stepMovement = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDList$Parent$Movement(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Parent$MovementMsg, cmds)); +}; +var $author$project$DnDList$Parent$stepOperationsOnDrag = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDList$Parent$OperationsOnDrag(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Parent$OperationsOnDragMsg, cmds)); +}; +var $author$project$DnDList$Parent$stepOperationsOnDrop = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDList$Parent$OperationsOnDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Parent$OperationsOnDropMsg, cmds)); +}; +var $author$project$DnDList$HookCommands$Parent$stepDetectDrop = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDList$HookCommands$Parent$DetectDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$HookCommands$Parent$DetectDropMsg, cmds)); +}; +var $author$project$DnDList$HookCommands$Parent$stepDetectReorder = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDList$HookCommands$Parent$DetectReorder(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$HookCommands$Parent$DetectReorderMsg, cmds)); +}; +var $elm$core$List$unzip = function (pairs) { + var step = F2( + function (_v0, _v1) { + var x = _v0.a; + var y = _v0.b; + var xs = _v1.a; + var ys = _v1.b; + return _Utils_Tuple2( + A2($elm$core$List$cons, x, xs), + A2($elm$core$List$cons, y, ys)); + }); + return A3( + $elm$core$List$foldr, + step, + _Utils_Tuple2(_List_Nil, _List_Nil), + pairs); +}; +var $author$project$DnDList$HookCommands$DetectDrop$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$HookCommands$DetectDrop$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; + return _Utils_Tuple2( + _Utils_update( + model, + {Z: dndModel, av: items}), + dndCmd); + } else { + var dragIndex = msg.a; + var dropIndex = msg.b; + return _Utils_Tuple2( + _Utils_update( + model, + { + aK: A2( + $elm$core$List$cons, + _Utils_Tuple2(dragIndex, dropIndex), + model.aK) + }), + $elm$core$Platform$Cmd$none); + } + }); +var $author$project$DnDList$HookCommands$DetectReorder$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$HookCommands$DetectReorder$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; + return _Utils_Tuple2( + _Utils_update( + model, + {Z: dndModel, av: items}), + dndCmd); + } else { + var dragIndex = msg.a; + var dropIndex = msg.b; + return _Utils_Tuple2( + _Utils_update( + model, + { + aK: A2( + $elm$core$List$cons, + _Utils_Tuple2(dragIndex, dropIndex), + model.aK) + }), + $elm$core$Platform$Cmd$none); + } + }); +var $author$project$DnDList$HookCommands$Parent$update = F2( + function (message, model) { + if (!message.$) { + var id = message.a; + return _Utils_Tuple2( + _Utils_update( + model, + {a7: id}), + $elm$core$Platform$Cmd$none); } else { - return 'https://'; + return function (_v2) { + var examples = _v2.a; + var cmds = _v2.b; + return _Utils_Tuple2( + _Utils_update( + model, + {at: examples}), + $elm$core$Platform$Cmd$batch(cmds)); + }( + $elm$core$List$unzip( + A2( + $elm$core$List$map, + function (example) { + var _v1 = _Utils_Tuple2(message, example); + _v1$2: + while (true) { + if (!_v1.b.$) { + if (_v1.a.$ === 1) { + var msg = _v1.a.a; + var mo = _v1.b.a; + return $author$project$DnDList$HookCommands$Parent$stepDetectDrop( + A2($author$project$DnDList$HookCommands$DetectDrop$update, msg, mo)); + } else { + break _v1$2; + } + } else { + if (_v1.a.$ === 2) { + var msg = _v1.a.a; + var mo = _v1.b.a; + return $author$project$DnDList$HookCommands$Parent$stepDetectReorder( + A2($author$project$DnDList$HookCommands$DetectReorder$update, msg, mo)); + } else { + break _v1$2; + } + } + } + return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); + }, + model.at))); } - }(); - return A3( - $elm$url$Url$addPrefixed, - '#', - url.bE, - A3( - $elm$url$Url$addPrefixed, - '?', - url.b_, - _Utils_ap( - A2( - $elm$url$Url$addPort, - url.bW, - _Utils_ap(http, url.bI)), - url.z))); -}; -var $author$project$Config$Root$stepMovement = function (_v0) { - var mo = _v0.a; - var cmds = _v0.b; - return _Utils_Tuple2( - $author$project$Config$Root$Movement(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Root$MovementMsg, cmds)); -}; -var $author$project$Config$Root$stepOperationsOnDrag = function (_v0) { - var mo = _v0.a; - var cmds = _v0.b; - return _Utils_Tuple2( - $author$project$Config$Root$OperationsOnDrag(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Root$OperationsOnDragMsg, cmds)); -}; -var $author$project$Config$Root$stepOperationsOnDrop = function (_v0) { - var mo = _v0.a; - var cmds = _v0.b; - return _Utils_Tuple2( - $author$project$Config$Root$OperationsOnDrop(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Root$OperationsOnDropMsg, cmds)); -}; -var $author$project$Config$Movement$Root$stepFreeOnDrag = function (_v0) { + }); +var $author$project$DnDList$Movement$Parent$stepFreeOnDrag = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$Movement$Root$FreeOnDrag(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Movement$Root$FreeOnDragMsg, cmds)); + $author$project$DnDList$Movement$Parent$FreeOnDrag(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Movement$Parent$FreeOnDragMsg, cmds)); }; -var $author$project$Config$Movement$Root$stepFreeOnDrop = function (_v0) { +var $author$project$DnDList$Movement$Parent$stepFreeOnDrop = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$Movement$Root$FreeOnDrop(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Movement$Root$FreeOnDropMsg, cmds)); + $author$project$DnDList$Movement$Parent$FreeOnDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Movement$Parent$FreeOnDropMsg, cmds)); }; -var $author$project$Config$Movement$Root$stepHorizontalOnDrag = function (_v0) { +var $author$project$DnDList$Movement$Parent$stepHorizontalOnDrag = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$Movement$Root$HorizontalOnDrag(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Movement$Root$HorizontalOnDragMsg, cmds)); + $author$project$DnDList$Movement$Parent$HorizontalOnDrag(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Movement$Parent$HorizontalOnDragMsg, cmds)); }; -var $author$project$Config$Movement$Root$stepHorizontalOnDrop = function (_v0) { +var $author$project$DnDList$Movement$Parent$stepHorizontalOnDrop = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$Movement$Root$HorizontalOnDrop(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Movement$Root$HorizontalOnDropMsg, cmds)); + $author$project$DnDList$Movement$Parent$HorizontalOnDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Movement$Parent$HorizontalOnDropMsg, cmds)); }; -var $author$project$Config$Movement$Root$stepVerticalOnDrag = function (_v0) { +var $author$project$DnDList$Movement$Parent$stepVerticalOnDrag = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$Movement$Root$VerticalOnDrag(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Movement$Root$VerticalOnDragMsg, cmds)); + $author$project$DnDList$Movement$Parent$VerticalOnDrag(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Movement$Parent$VerticalOnDragMsg, cmds)); }; -var $author$project$Config$Movement$Root$stepVerticalOnDrop = function (_v0) { +var $author$project$DnDList$Movement$Parent$stepVerticalOnDrop = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$Movement$Root$VerticalOnDrop(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$Movement$Root$VerticalOnDropMsg, cmds)); -}; -var $elm$core$List$unzip = function (pairs) { - var step = F2( - function (_v0, _v1) { - var x = _v0.a; - var y = _v0.b; - var xs = _v1.a; - var ys = _v1.b; - return _Utils_Tuple2( - A2($elm$core$List$cons, x, xs), - A2($elm$core$List$cons, y, ys)); - }); - return A3( - $elm$core$List$foldr, - step, - _Utils_Tuple2(_List_Nil, _List_Nil), - pairs); -}; -var $author$project$Config$Movement$FreeOnDrag$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$Movement$FreeOnDrag$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + $author$project$DnDList$Movement$Parent$VerticalOnDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$Movement$Parent$VerticalOnDropMsg, cmds)); +}; +var $author$project$DnDList$Movement$FreeOnDrag$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$Movement$FreeOnDrag$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var affected = function () { - var _v2 = $author$project$Config$Movement$FreeOnDrag$system.be(dnd); + var _v2 = $author$project$DnDList$Movement$FreeOnDrag$system.bX(dndModel); if (!_v2.$) { - var dragIndex = _v2.a.a9; - var dropIndex = _v2.a.cV; + var dragIndex = _v2.a.c; + var dropIndex = _v2.a.h; return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$cons, dragIndex, @@ -10805,8 +11601,8 @@ var $author$project$Config$Movement$FreeOnDrag$update = F2( return _Utils_Tuple2( _Utils_update( model, - {I: affected, aa: dnd, au: items}), - $author$project$Config$Movement$FreeOnDrag$system.cM(dnd)); + {I: affected, Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( @@ -10815,18 +11611,19 @@ var $author$project$Config$Movement$FreeOnDrag$update = F2( $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$Movement$FreeOnDrop$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$Movement$FreeOnDrop$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$Movement$FreeOnDrop$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$Movement$FreeOnDrop$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var affected = function () { - var _v2 = $author$project$Config$Movement$FreeOnDrop$system.be(dnd); + var _v2 = $author$project$DnDList$Movement$FreeOnDrop$system.bX(dndModel); if (!_v2.$) { - var dragIndex = _v2.a.a9; - var dropIndex = _v2.a.cV; + var dragIndex = _v2.a.c; + var dropIndex = _v2.a.h; return (!_Utils_eq(dragIndex, dropIndex)) ? _List_fromArray( [dragIndex, dropIndex]) : _List_Nil; } else { @@ -10836,8 +11633,8 @@ var $author$project$Config$Movement$FreeOnDrop$update = F2( return _Utils_Tuple2( _Utils_update( model, - {I: affected, aa: dnd, au: items}), - $author$project$Config$Movement$FreeOnDrop$system.cM(dnd)); + {I: affected, Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( @@ -10846,18 +11643,19 @@ var $author$project$Config$Movement$FreeOnDrop$update = F2( $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$Movement$HorizontalOnDrag$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$Movement$HorizontalOnDrag$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$Movement$HorizontalOnDrag$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$Movement$HorizontalOnDrag$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var affected = function () { - var _v2 = $author$project$Config$Movement$HorizontalOnDrag$system.be(dnd); + var _v2 = $author$project$DnDList$Movement$HorizontalOnDrag$system.bX(dndModel); if (!_v2.$) { - var dragIndex = _v2.a.a9; - var dropIndex = _v2.a.cV; + var dragIndex = _v2.a.c; + var dropIndex = _v2.a.h; return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$cons, dragIndex, @@ -10869,8 +11667,8 @@ var $author$project$Config$Movement$HorizontalOnDrag$update = F2( return _Utils_Tuple2( _Utils_update( model, - {I: affected, aa: dnd, au: items}), - $author$project$Config$Movement$HorizontalOnDrag$system.cM(dnd)); + {I: affected, Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( @@ -10879,18 +11677,19 @@ var $author$project$Config$Movement$HorizontalOnDrag$update = F2( $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$Movement$HorizontalOnDrop$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$Movement$HorizontalOnDrop$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$Movement$HorizontalOnDrop$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$Movement$HorizontalOnDrop$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var affected = function () { - var _v2 = $author$project$Config$Movement$HorizontalOnDrop$system.be(dnd); + var _v2 = $author$project$DnDList$Movement$HorizontalOnDrop$system.bX(dndModel); if (!_v2.$) { - var dragIndex = _v2.a.a9; - var dropIndex = _v2.a.cV; + var dragIndex = _v2.a.c; + var dropIndex = _v2.a.h; return (!_Utils_eq(dragIndex, dropIndex)) ? _List_fromArray( [dragIndex, dropIndex]) : _List_Nil; } else { @@ -10900,8 +11699,8 @@ var $author$project$Config$Movement$HorizontalOnDrop$update = F2( return _Utils_Tuple2( _Utils_update( model, - {I: affected, aa: dnd, au: items}), - $author$project$Config$Movement$HorizontalOnDrop$system.cM(dnd)); + {I: affected, Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( @@ -10910,18 +11709,19 @@ var $author$project$Config$Movement$HorizontalOnDrop$update = F2( $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$Movement$VerticalOnDrag$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$Movement$VerticalOnDrag$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$Movement$VerticalOnDrag$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$Movement$VerticalOnDrag$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var affected = function () { - var _v2 = $author$project$Config$Movement$VerticalOnDrag$system.be(dnd); + var _v2 = $author$project$DnDList$Movement$VerticalOnDrag$system.bX(dndModel); if (!_v2.$) { - var dragIndex = _v2.a.a9; - var dropIndex = _v2.a.cV; + var dragIndex = _v2.a.c; + var dropIndex = _v2.a.h; return (!_Utils_eq(dragIndex, dropIndex)) ? A2( $elm$core$List$cons, dragIndex, @@ -10933,8 +11733,8 @@ var $author$project$Config$Movement$VerticalOnDrag$update = F2( return _Utils_Tuple2( _Utils_update( model, - {I: affected, aa: dnd, au: items}), - $author$project$Config$Movement$VerticalOnDrag$system.cM(dnd)); + {I: affected, Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( @@ -10943,18 +11743,19 @@ var $author$project$Config$Movement$VerticalOnDrag$update = F2( $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$Movement$VerticalOnDrop$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$Movement$VerticalOnDrop$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$Movement$VerticalOnDrop$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$Movement$VerticalOnDrop$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var affected = function () { - var _v2 = $author$project$Config$Movement$VerticalOnDrop$system.be(dnd); + var _v2 = $author$project$DnDList$Movement$VerticalOnDrop$system.bX(dndModel); if (!_v2.$) { - var dragIndex = _v2.a.a9; - var dropIndex = _v2.a.cV; + var dragIndex = _v2.a.c; + var dropIndex = _v2.a.h; return (!_Utils_eq(dragIndex, dropIndex)) ? _List_fromArray( [dragIndex, dropIndex]) : _List_Nil; } else { @@ -10964,8 +11765,8 @@ var $author$project$Config$Movement$VerticalOnDrop$update = F2( return _Utils_Tuple2( _Utils_update( model, - {I: affected, aa: dnd, au: items}), - $author$project$Config$Movement$VerticalOnDrop$system.cM(dnd)); + {I: affected, Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( @@ -10974,14 +11775,14 @@ var $author$project$Config$Movement$VerticalOnDrop$update = F2( $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$Movement$Root$update = F2( +var $author$project$DnDList$Movement$Parent$update = F2( function (message, model) { if (!message.$) { var id = message.a; return _Utils_Tuple2( _Utils_update( model, - {at: id}), + {a7: id}), $elm$core$Platform$Cmd$none); } else { return function (_v2) { @@ -10990,7 +11791,7 @@ var $author$project$Config$Movement$Root$update = F2( return _Utils_Tuple2( _Utils_update( model, - {Q: examples}), + {at: examples}), $elm$core$Platform$Cmd$batch(cmds)); }( $elm$core$List$unzip( @@ -11005,8 +11806,8 @@ var $author$project$Config$Movement$Root$update = F2( if (_v1.a.$ === 1) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$Movement$Root$stepFreeOnDrag( - A2($author$project$Config$Movement$FreeOnDrag$update, msg, mo)); + return $author$project$DnDList$Movement$Parent$stepFreeOnDrag( + A2($author$project$DnDList$Movement$FreeOnDrag$update, msg, mo)); } else { break _v1$6; } @@ -11014,8 +11815,8 @@ var $author$project$Config$Movement$Root$update = F2( if (_v1.a.$ === 2) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$Movement$Root$stepFreeOnDrop( - A2($author$project$Config$Movement$FreeOnDrop$update, msg, mo)); + return $author$project$DnDList$Movement$Parent$stepFreeOnDrop( + A2($author$project$DnDList$Movement$FreeOnDrop$update, msg, mo)); } else { break _v1$6; } @@ -11023,8 +11824,8 @@ var $author$project$Config$Movement$Root$update = F2( if (_v1.a.$ === 3) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$Movement$Root$stepHorizontalOnDrag( - A2($author$project$Config$Movement$HorizontalOnDrag$update, msg, mo)); + return $author$project$DnDList$Movement$Parent$stepHorizontalOnDrag( + A2($author$project$DnDList$Movement$HorizontalOnDrag$update, msg, mo)); } else { break _v1$6; } @@ -11032,8 +11833,8 @@ var $author$project$Config$Movement$Root$update = F2( if (_v1.a.$ === 4) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$Movement$Root$stepHorizontalOnDrop( - A2($author$project$Config$Movement$HorizontalOnDrop$update, msg, mo)); + return $author$project$DnDList$Movement$Parent$stepHorizontalOnDrop( + A2($author$project$DnDList$Movement$HorizontalOnDrop$update, msg, mo)); } else { break _v1$6; } @@ -11041,8 +11842,8 @@ var $author$project$Config$Movement$Root$update = F2( if (_v1.a.$ === 5) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$Movement$Root$stepVerticalOnDrag( - A2($author$project$Config$Movement$VerticalOnDrag$update, msg, mo)); + return $author$project$DnDList$Movement$Parent$stepVerticalOnDrag( + A2($author$project$DnDList$Movement$VerticalOnDrag$update, msg, mo)); } else { break _v1$6; } @@ -11050,8 +11851,8 @@ var $author$project$Config$Movement$Root$update = F2( if (_v1.a.$ === 6) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$Movement$Root$stepVerticalOnDrop( - A2($author$project$Config$Movement$VerticalOnDrop$update, msg, mo)); + return $author$project$DnDList$Movement$Parent$stepVerticalOnDrop( + A2($author$project$DnDList$Movement$VerticalOnDrop$update, msg, mo)); } else { break _v1$6; } @@ -11059,192 +11860,197 @@ var $author$project$Config$Movement$Root$update = F2( } return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); }, - model.Q))); + model.at))); } }); -var $author$project$Config$OperationsOnDrag$Root$stepInsertAfter = function (_v0) { +var $author$project$DnDList$OperationsOnDrag$Parent$stepInsertAfter = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrag$Root$InsertAfter(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrag$Root$InsertAfterMsg, cmds)); + $author$project$DnDList$OperationsOnDrag$Parent$InsertAfter(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrag$Parent$InsertAfterMsg, cmds)); }; -var $author$project$Config$OperationsOnDrag$Root$stepInsertBefore = function (_v0) { +var $author$project$DnDList$OperationsOnDrag$Parent$stepInsertBefore = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrag$Root$InsertBefore(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrag$Root$InsertBeforeMsg, cmds)); + $author$project$DnDList$OperationsOnDrag$Parent$InsertBefore(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrag$Parent$InsertBeforeMsg, cmds)); }; -var $author$project$Config$OperationsOnDrag$Root$stepRotate = function (_v0) { +var $author$project$DnDList$OperationsOnDrag$Parent$stepRotate = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrag$Root$Rotate(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrag$Root$RotateMsg, cmds)); + $author$project$DnDList$OperationsOnDrag$Parent$Rotate(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrag$Parent$RotateMsg, cmds)); }; -var $author$project$Config$OperationsOnDrag$Root$stepSwap = function (_v0) { +var $author$project$DnDList$OperationsOnDrag$Parent$stepSwap = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrag$Root$Swap(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrag$Root$SwapMsg, cmds)); + $author$project$DnDList$OperationsOnDrag$Parent$Swap(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrag$Parent$SwapMsg, cmds)); }; -var $author$project$Config$OperationsOnDrag$Root$stepUnaltered = function (_v0) { +var $author$project$DnDList$OperationsOnDrag$Parent$stepUnaltered = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrag$Root$Unaltered(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrag$Root$UnalteredMsg, cmds)); -}; -var $author$project$Config$OperationsOnDrag$InsertAfter$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrag$InsertAfter$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + $author$project$DnDList$OperationsOnDrag$Parent$Unaltered(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrag$Parent$UnalteredMsg, cmds)); +}; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrag$InsertAfter$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrag$InsertAfter$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrag$InsertAfter$Item, value, $author$project$Config$OperationsOnDrag$InsertAfter$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrag$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrag$InsertAfter$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrag$InsertBefore$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrag$InsertBefore$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrag$InsertBefore$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrag$InsertBefore$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrag$InsertBefore$Item, value, $author$project$Config$OperationsOnDrag$InsertBefore$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrag$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrag$InsertBefore$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrag$Rotate$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrag$Rotate$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrag$Rotate$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrag$Rotate$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrag$Rotate$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrag$Rotate$Item, value, $author$project$Config$OperationsOnDrag$Rotate$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrag$Rotate$Item, value, $author$project$DnDList$OperationsOnDrag$Rotate$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrag$Swap$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrag$Swap$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrag$Swap$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrag$Swap$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrag$Swap$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrag$Swap$Item, value, $author$project$Config$OperationsOnDrag$Swap$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrag$Swap$Item, value, $author$project$DnDList$OperationsOnDrag$Swap$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrag$Unaltered$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrag$Unaltered$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrag$Unaltered$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrag$Unaltered$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrag$Unaltered$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrag$Unaltered$Item, value, $author$project$Config$OperationsOnDrag$Unaltered$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrag$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrag$Unaltered$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrag$Root$update = F2( +var $author$project$DnDList$OperationsOnDrag$Parent$update = F2( function (message, model) { if (!message.$) { var id = message.a; return _Utils_Tuple2( _Utils_update( model, - {at: id}), + {a7: id}), $elm$core$Platform$Cmd$none); } else { return function (_v2) { @@ -11253,7 +12059,7 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( return _Utils_Tuple2( _Utils_update( model, - {Q: examples}), + {at: examples}), $elm$core$Platform$Cmd$batch(cmds)); }( $elm$core$List$unzip( @@ -11268,8 +12074,8 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 1) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrag$Root$stepInsertAfter( - A2($author$project$Config$OperationsOnDrag$InsertAfter$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrag$Parent$stepInsertAfter( + A2($author$project$DnDList$OperationsOnDrag$InsertAfter$update, msg, mo)); } else { break _v1$5; } @@ -11277,8 +12083,8 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 2) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrag$Root$stepInsertBefore( - A2($author$project$Config$OperationsOnDrag$InsertBefore$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrag$Parent$stepInsertBefore( + A2($author$project$DnDList$OperationsOnDrag$InsertBefore$update, msg, mo)); } else { break _v1$5; } @@ -11286,8 +12092,8 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 3) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrag$Root$stepRotate( - A2($author$project$Config$OperationsOnDrag$Rotate$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrag$Parent$stepRotate( + A2($author$project$DnDList$OperationsOnDrag$Rotate$update, msg, mo)); } else { break _v1$5; } @@ -11295,8 +12101,8 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 4) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrag$Root$stepSwap( - A2($author$project$Config$OperationsOnDrag$Swap$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrag$Parent$stepSwap( + A2($author$project$DnDList$OperationsOnDrag$Swap$update, msg, mo)); } else { break _v1$5; } @@ -11304,8 +12110,8 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 5) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrag$Root$stepUnaltered( - A2($author$project$Config$OperationsOnDrag$Unaltered$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrag$Parent$stepUnaltered( + A2($author$project$DnDList$OperationsOnDrag$Unaltered$update, msg, mo)); } else { break _v1$5; } @@ -11313,192 +12119,197 @@ var $author$project$Config$OperationsOnDrag$Root$update = F2( } return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); }, - model.Q))); + model.at))); } }); -var $author$project$Config$OperationsOnDrop$Root$stepInsertAfter = function (_v0) { +var $author$project$DnDList$OperationsOnDrop$Parent$stepInsertAfter = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrop$Root$InsertAfter(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrop$Root$InsertAfterMsg, cmds)); + $author$project$DnDList$OperationsOnDrop$Parent$InsertAfter(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrop$Parent$InsertAfterMsg, cmds)); }; -var $author$project$Config$OperationsOnDrop$Root$stepInsertBefore = function (_v0) { +var $author$project$DnDList$OperationsOnDrop$Parent$stepInsertBefore = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrop$Root$InsertBefore(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrop$Root$InsertBeforeMsg, cmds)); + $author$project$DnDList$OperationsOnDrop$Parent$InsertBefore(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrop$Parent$InsertBeforeMsg, cmds)); }; -var $author$project$Config$OperationsOnDrop$Root$stepRotate = function (_v0) { +var $author$project$DnDList$OperationsOnDrop$Parent$stepRotate = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrop$Root$Rotate(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrop$Root$RotateMsg, cmds)); + $author$project$DnDList$OperationsOnDrop$Parent$Rotate(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrop$Parent$RotateMsg, cmds)); }; -var $author$project$Config$OperationsOnDrop$Root$stepSwap = function (_v0) { +var $author$project$DnDList$OperationsOnDrop$Parent$stepSwap = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrop$Root$Swap(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrop$Root$SwapMsg, cmds)); + $author$project$DnDList$OperationsOnDrop$Parent$Swap(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrop$Parent$SwapMsg, cmds)); }; -var $author$project$Config$OperationsOnDrop$Root$stepUnaltered = function (_v0) { +var $author$project$DnDList$OperationsOnDrop$Parent$stepUnaltered = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Config$OperationsOnDrop$Root$Unaltered(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Config$OperationsOnDrop$Root$UnalteredMsg, cmds)); -}; -var $author$project$Config$OperationsOnDrop$InsertAfter$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrop$InsertAfter$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + $author$project$DnDList$OperationsOnDrop$Parent$Unaltered(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDList$OperationsOnDrop$Parent$UnalteredMsg, cmds)); +}; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrop$InsertAfter$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrop$InsertAfter$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrop$InsertAfter$Item, value, $author$project$Config$OperationsOnDrop$InsertAfter$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrop$InsertAfter$Item, value, $author$project$DnDList$OperationsOnDrop$InsertAfter$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrop$InsertBefore$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrop$InsertBefore$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrop$InsertBefore$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrop$InsertBefore$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrop$InsertBefore$Item, value, $author$project$Config$OperationsOnDrop$InsertBefore$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrop$InsertBefore$Item, value, $author$project$DnDList$OperationsOnDrop$InsertBefore$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrop$Rotate$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrop$Rotate$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrop$Rotate$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrop$Rotate$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrop$Rotate$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrop$Rotate$Item, value, $author$project$Config$OperationsOnDrop$Rotate$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrop$Rotate$Item, value, $author$project$DnDList$OperationsOnDrop$Rotate$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrop$Swap$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrop$Swap$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrop$Swap$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrop$Swap$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrop$Swap$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrop$Swap$Item, value, $author$project$Config$OperationsOnDrop$Swap$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrop$Swap$Item, value, $author$project$DnDList$OperationsOnDrop$Swap$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrop$Unaltered$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Config$OperationsOnDrop$Unaltered$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDList$OperationsOnDrop$Unaltered$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDList$OperationsOnDrop$Unaltered$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Config$OperationsOnDrop$Unaltered$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var value = _v2.aB; - return A2($author$project$Config$OperationsOnDrop$Unaltered$Item, value, $author$project$Config$OperationsOnDrop$Unaltered$baseColor); + var value = _v2.aC; + return A2($author$project$DnDList$OperationsOnDrop$Unaltered$Item, value, $author$project$DnDList$OperationsOnDrop$Unaltered$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$Config$OperationsOnDrop$Root$update = F2( +var $author$project$DnDList$OperationsOnDrop$Parent$update = F2( function (message, model) { if (!message.$) { var id = message.a; return _Utils_Tuple2( _Utils_update( model, - {at: id}), + {a7: id}), $elm$core$Platform$Cmd$none); } else { return function (_v2) { @@ -11507,7 +12318,7 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( return _Utils_Tuple2( _Utils_update( model, - {Q: examples}), + {at: examples}), $elm$core$Platform$Cmd$batch(cmds)); }( $elm$core$List$unzip( @@ -11522,8 +12333,8 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 1) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrop$Root$stepInsertAfter( - A2($author$project$Config$OperationsOnDrop$InsertAfter$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrop$Parent$stepInsertAfter( + A2($author$project$DnDList$OperationsOnDrop$InsertAfter$update, msg, mo)); } else { break _v1$5; } @@ -11531,8 +12342,8 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 2) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrop$Root$stepInsertBefore( - A2($author$project$Config$OperationsOnDrop$InsertBefore$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrop$Parent$stepInsertBefore( + A2($author$project$DnDList$OperationsOnDrop$InsertBefore$update, msg, mo)); } else { break _v1$5; } @@ -11540,8 +12351,8 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 3) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrop$Root$stepRotate( - A2($author$project$Config$OperationsOnDrop$Rotate$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrop$Parent$stepRotate( + A2($author$project$DnDList$OperationsOnDrop$Rotate$update, msg, mo)); } else { break _v1$5; } @@ -11549,8 +12360,8 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 4) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrop$Root$stepSwap( - A2($author$project$Config$OperationsOnDrop$Swap$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrop$Parent$stepSwap( + A2($author$project$DnDList$OperationsOnDrop$Swap$update, msg, mo)); } else { break _v1$5; } @@ -11558,8 +12369,8 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 5) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$Config$OperationsOnDrop$Root$stepUnaltered( - A2($author$project$Config$OperationsOnDrop$Unaltered$update, msg, mo)); + return $author$project$DnDList$OperationsOnDrop$Parent$stepUnaltered( + A2($author$project$DnDList$OperationsOnDrop$Unaltered$update, msg, mo)); } else { break _v1$5; } @@ -11567,212 +12378,353 @@ var $author$project$Config$OperationsOnDrop$Root$update = F2( } return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); }, - model.Q))); + model.at))); } }); -var $author$project$Config$Root$update = F2( +var $author$project$DnDList$Parent$update = F2( function (message, model) { var _v0 = _Utils_Tuple2(message, model); - _v0$3: + _v0$4: while (true) { switch (_v0.a.$) { case 0: if (!_v0.b.$) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Config$Root$stepMovement( - A2($author$project$Config$Movement$Root$update, msg, mo)); + return $author$project$DnDList$Parent$stepMovement( + A2($author$project$DnDList$Movement$Parent$update, msg, mo)); } else { - break _v0$3; + break _v0$4; } case 1: if (_v0.b.$ === 1) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Config$Root$stepOperationsOnDrag( - A2($author$project$Config$OperationsOnDrag$Root$update, msg, mo)); + return $author$project$DnDList$Parent$stepOperationsOnDrag( + A2($author$project$DnDList$OperationsOnDrag$Parent$update, msg, mo)); } else { - break _v0$3; + break _v0$4; } - default: + case 2: if (_v0.b.$ === 2) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Config$Root$stepOperationsOnDrop( - A2($author$project$Config$OperationsOnDrop$Root$update, msg, mo)); + return $author$project$DnDList$Parent$stepOperationsOnDrop( + A2($author$project$DnDList$OperationsOnDrop$Parent$update, msg, mo)); } else { - break _v0$3; + break _v0$4; + } + default: + if (_v0.b.$ === 3) { + var msg = _v0.a.a; + var mo = _v0.b.a; + return $author$project$DnDList$Parent$stepHookCommands( + A2($author$project$DnDList$HookCommands$Parent$update, msg, mo)); + } else { + break _v0$4; } } } return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); }); -var $author$project$ConfigGroups$Root$stepOperationsOnDrag = function (_v0) { +var $author$project$DnDListGroups$Parent$stepHookCommands = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDListGroups$Parent$HookCommands(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$Parent$HookCommandsMsg, cmds)); +}; +var $author$project$DnDListGroups$Parent$stepOperationsOnDrag = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$Root$OperationsOnDrag(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$Root$OperationsOnDragMsg, cmds)); + $author$project$DnDListGroups$Parent$OperationsOnDrag(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$Parent$OperationsOnDragMsg, cmds)); }; -var $author$project$ConfigGroups$Root$stepOperationsOnDrop = function (_v0) { +var $author$project$DnDListGroups$Parent$stepOperationsOnDrop = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$Root$OperationsOnDrop(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$Root$OperationsOnDropMsg, cmds)); + $author$project$DnDListGroups$Parent$OperationsOnDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$Parent$OperationsOnDropMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$stepInsertAfter = function (_v0) { +var $author$project$DnDListGroups$HookCommands$Parent$stepDetectDrop = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfter(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfterMsg, cmds)); + $author$project$DnDListGroups$HookCommands$Parent$DetectDrop(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$HookCommands$Parent$DetectDropMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$stepInsertBefore = function (_v0) { +var $author$project$DnDListGroups$HookCommands$Parent$stepDetectReorder = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDListGroups$HookCommands$Parent$DetectReorder(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$HookCommands$Parent$DetectReorderMsg, cmds)); +}; +var $author$project$DnDListGroups$HookCommands$DetectDrop$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$HookCommands$DetectDrop$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; + return _Utils_Tuple2( + _Utils_update( + model, + {Z: dndModel, av: items}), + dndCmd); + } else { + var dragIndex = msg.a; + var dropIndex = msg.b; + return _Utils_Tuple2( + _Utils_update( + model, + { + aK: A2( + $elm$core$List$cons, + _Utils_Tuple2(dragIndex, dropIndex), + model.aK) + }), + $elm$core$Platform$Cmd$none); + } + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$HookCommands$DetectReorder$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; + return _Utils_Tuple2( + _Utils_update( + model, + {Z: dndModel, av: items}), + dndCmd); + } else { + var dragIndex = msg.a; + var dropIndex = msg.b; + return _Utils_Tuple2( + _Utils_update( + model, + { + aK: A2( + $elm$core$List$cons, + _Utils_Tuple2(dragIndex, dropIndex), + model.aK) + }), + $elm$core$Platform$Cmd$none); + } + }); +var $author$project$DnDListGroups$HookCommands$Parent$update = F2( + function (message, model) { + if (!message.$) { + var id = message.a; + return _Utils_Tuple2( + _Utils_update( + model, + {a7: id}), + $elm$core$Platform$Cmd$none); + } else { + return function (_v2) { + var examples = _v2.a; + var cmds = _v2.b; + return _Utils_Tuple2( + _Utils_update( + model, + {at: examples}), + $elm$core$Platform$Cmd$batch(cmds)); + }( + $elm$core$List$unzip( + A2( + $elm$core$List$map, + function (example) { + var _v1 = _Utils_Tuple2(message, example); + _v1$2: + while (true) { + if (!_v1.b.$) { + if (_v1.a.$ === 1) { + var msg = _v1.a.a; + var mo = _v1.b.a; + return $author$project$DnDListGroups$HookCommands$Parent$stepDetectDrop( + A2($author$project$DnDListGroups$HookCommands$DetectDrop$update, msg, mo)); + } else { + break _v1$2; + } + } else { + if (_v1.a.$ === 2) { + var msg = _v1.a.a; + var mo = _v1.b.a; + return $author$project$DnDListGroups$HookCommands$Parent$stepDetectReorder( + A2($author$project$DnDListGroups$HookCommands$DetectReorder$update, msg, mo)); + } else { + break _v1$2; + } + } + } + return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); + }, + model.at))); + } + }); +var $author$project$DnDListGroups$OperationsOnDrag$Parent$stepInsertAfter = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBefore(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBeforeMsg, cmds)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfter(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfterMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$stepRotate = function (_v0) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$stepInsertBefore = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrag$Root$Rotate(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrag$Root$RotateMsg, cmds)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBefore(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBeforeMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$stepSwap = function (_v0) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$stepRotate = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrag$Root$Swap(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrag$Root$SwapMsg, cmds)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$Rotate(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrag$Parent$RotateMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$stepSwap = function (_v0) { + var mo = _v0.a; + var cmds = _v0.b; + return _Utils_Tuple2( + $author$project$DnDListGroups$OperationsOnDrag$Parent$Swap(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrag$Parent$SwapMsg, cmds)); +}; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$Item, group, value, $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$Item, group, value, $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$Item, group, value, $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$Item, group, value, $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrag$Rotate$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$Item, group, value, $author$project$ConfigGroups$OperationsOnDrag$Rotate$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$Item, group, value, $author$project$DnDListGroups$OperationsOnDrag$Rotate$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrag$Swap$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrag$Swap$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrag$Swap$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrag$Swap$Item, group, value, $author$project$ConfigGroups$OperationsOnDrag$Swap$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrag$Swap$Item, group, value, $author$project$DnDListGroups$OperationsOnDrag$Swap$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( +var $author$project$DnDListGroups$OperationsOnDrag$Parent$update = F2( function (message, model) { if (!message.$) { var id = message.a; return _Utils_Tuple2( _Utils_update( model, - {at: id}), + {a7: id}), $elm$core$Platform$Cmd$none); } else { return function (_v2) { @@ -11781,7 +12733,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( return _Utils_Tuple2( _Utils_update( model, - {Q: examples}), + {at: examples}), $elm$core$Platform$Cmd$batch(cmds)); }( $elm$core$List$unzip( @@ -11796,8 +12748,8 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 1) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrag$Root$stepInsertAfter( - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrag$Parent$stepInsertAfter( + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$update, msg, mo)); } else { break _v1$4; } @@ -11805,8 +12757,8 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 2) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrag$Root$stepInsertBefore( - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrag$Parent$stepInsertBefore( + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$update, msg, mo)); } else { break _v1$4; } @@ -11814,8 +12766,8 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 3) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrag$Root$stepRotate( - A2($author$project$ConfigGroups$OperationsOnDrag$Rotate$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrag$Parent$stepRotate( + A2($author$project$DnDListGroups$OperationsOnDrag$Rotate$update, msg, mo)); } else { break _v1$4; } @@ -11823,8 +12775,8 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( if (_v1.a.$ === 4) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrag$Root$stepSwap( - A2($author$project$ConfigGroups$OperationsOnDrag$Swap$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrag$Parent$stepSwap( + A2($author$project$DnDListGroups$OperationsOnDrag$Swap$update, msg, mo)); } else { break _v1$4; } @@ -11832,161 +12784,165 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$update = F2( } return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); }, - model.Q))); + model.at))); } }); -var $author$project$ConfigGroups$OperationsOnDrop$Root$stepInsertAfter = function (_v0) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$stepInsertAfter = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfter(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfterMsg, cmds)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfter(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfterMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$stepInsertBefore = function (_v0) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$stepInsertBefore = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBefore(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBeforeMsg, cmds)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBefore(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBeforeMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$stepRotate = function (_v0) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$stepRotate = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrop$Root$Rotate(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrop$Root$RotateMsg, cmds)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$Rotate(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrop$Parent$RotateMsg, cmds)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$stepSwap = function (_v0) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$stepSwap = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrop$Root$Swap(mo), - A2($elm$core$Platform$Cmd$map, $author$project$ConfigGroups$OperationsOnDrop$Root$SwapMsg, cmds)); -}; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + $author$project$DnDListGroups$OperationsOnDrop$Parent$Swap(mo), + A2($elm$core$Platform$Cmd$map, $author$project$DnDListGroups$OperationsOnDrop$Parent$SwapMsg, cmds)); +}; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$Item, group, value, $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$Item, group, value, $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$Item, group, value, $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$Item, group, value, $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrop$Rotate$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$Item, group, value, $author$project$ConfigGroups$OperationsOnDrop$Rotate$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$Item, group, value, $author$project$DnDListGroups$OperationsOnDrop$Rotate$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$ConfigGroups$OperationsOnDrop$Swap$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$update = F2( + function (msg, model) { + if (!msg.$) { + var dndMsg = msg.a; + var _v1 = A3($author$project$DnDListGroups$OperationsOnDrop$Swap$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$ConfigGroups$OperationsOnDrop$Swap$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } else { return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$map, function (_v2) { - var group = _v2.t; - var value = _v2.aB; - return A3($author$project$ConfigGroups$OperationsOnDrop$Swap$Item, group, value, $author$project$ConfigGroups$OperationsOnDrop$Swap$baseColor); + var group = _v2.x; + var value = _v2.aC; + return A3($author$project$DnDListGroups$OperationsOnDrop$Swap$Item, group, value, $author$project$DnDListGroups$OperationsOnDrop$Swap$baseColor); }, - model.au) + model.av) }), $elm$core$Platform$Cmd$none); } }); -var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Parent$update = F2( function (message, model) { if (!message.$) { var id = message.a; return _Utils_Tuple2( _Utils_update( model, - {at: id}), + {a7: id}), $elm$core$Platform$Cmd$none); } else { return function (_v2) { @@ -11995,7 +12951,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( return _Utils_Tuple2( _Utils_update( model, - {Q: examples}), + {at: examples}), $elm$core$Platform$Cmd$batch(cmds)); }( $elm$core$List$unzip( @@ -12010,8 +12966,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 1) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrop$Root$stepInsertAfter( - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrop$Parent$stepInsertAfter( + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$update, msg, mo)); } else { break _v1$4; } @@ -12019,8 +12975,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 2) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrop$Root$stepInsertBefore( - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrop$Parent$stepInsertBefore( + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$update, msg, mo)); } else { break _v1$4; } @@ -12028,8 +12984,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 3) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrop$Root$stepRotate( - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrop$Parent$stepRotate( + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$update, msg, mo)); } else { break _v1$4; } @@ -12037,8 +12993,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( if (_v1.a.$ === 4) { var msg = _v1.a.a; var mo = _v1.b.a; - return $author$project$ConfigGroups$OperationsOnDrop$Root$stepSwap( - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$update, msg, mo)); + return $author$project$DnDListGroups$OperationsOnDrop$Parent$stepSwap( + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$update, msg, mo)); } else { break _v1$4; } @@ -12046,77 +13002,87 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$update = F2( } return _Utils_Tuple2(example, $elm$core$Platform$Cmd$none); }, - model.Q))); + model.at))); } }); -var $author$project$ConfigGroups$Root$update = F2( +var $author$project$DnDListGroups$Parent$update = F2( function (message, model) { var _v0 = _Utils_Tuple2(message, model); - _v0$2: + _v0$3: while (true) { - if (!_v0.a.$) { - if (!_v0.b.$) { - var msg = _v0.a.a; - var mo = _v0.b.a; - return $author$project$ConfigGroups$Root$stepOperationsOnDrag( - A2($author$project$ConfigGroups$OperationsOnDrag$Root$update, msg, mo)); - } else { - break _v0$2; - } - } else { - if (_v0.b.$ === 1) { - var msg = _v0.a.a; - var mo = _v0.b.a; - return $author$project$ConfigGroups$Root$stepOperationsOnDrop( - A2($author$project$ConfigGroups$OperationsOnDrop$Root$update, msg, mo)); - } else { - break _v0$2; - } + switch (_v0.a.$) { + case 0: + if (!_v0.b.$) { + var msg = _v0.a.a; + var mo = _v0.b.a; + return $author$project$DnDListGroups$Parent$stepOperationsOnDrag( + A2($author$project$DnDListGroups$OperationsOnDrag$Parent$update, msg, mo)); + } else { + break _v0$3; + } + case 1: + if (_v0.b.$ === 1) { + var msg = _v0.a.a; + var mo = _v0.b.a; + return $author$project$DnDListGroups$Parent$stepOperationsOnDrop( + A2($author$project$DnDListGroups$OperationsOnDrop$Parent$update, msg, mo)); + } else { + break _v0$3; + } + default: + if (_v0.b.$ === 2) { + var msg = _v0.a.a; + var mo = _v0.b.a; + return $author$project$DnDListGroups$Parent$stepHookCommands( + A2($author$project$DnDListGroups$HookCommands$Parent$update, msg, mo)); + } else { + break _v0$3; + } } } return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); }); -var $author$project$Gallery$Root$stepHanoi = function (_v0) { +var $author$project$Gallery$Parent$stepHanoi = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Gallery$Root$Hanoi(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$HanoiMsg, cmds)); + $author$project$Gallery$Parent$Hanoi(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$HanoiMsg, cmds)); }; -var $author$project$Gallery$Root$stepKnight = function (_v0) { +var $author$project$Gallery$Parent$stepKnight = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Gallery$Root$Knight(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$KnightMsg, cmds)); + $author$project$Gallery$Parent$Knight(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$KnightMsg, cmds)); }; -var $author$project$Gallery$Root$stepPuzzle = function (_v0) { +var $author$project$Gallery$Parent$stepPuzzle = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Gallery$Root$Puzzle(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$PuzzleMsg, cmds)); + $author$project$Gallery$Parent$Puzzle(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$PuzzleMsg, cmds)); }; -var $author$project$Gallery$Root$stepShapes = function (_v0) { +var $author$project$Gallery$Parent$stepShapes = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Gallery$Root$Shapes(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$ShapesMsg, cmds)); + $author$project$Gallery$Parent$Shapes(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$ShapesMsg, cmds)); }; -var $author$project$Gallery$Root$stepTaskBoard = function (_v0) { +var $author$project$Gallery$Parent$stepTaskBoard = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Gallery$Root$TaskBoard(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$TaskBoardMsg, cmds)); + $author$project$Gallery$Parent$TaskBoard(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$TaskBoardMsg, cmds)); }; -var $author$project$Gallery$Root$stepTryOn = function (_v0) { +var $author$project$Gallery$Parent$stepTryOn = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Gallery$Root$TryOn(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Root$TryOnMsg, cmds)); + $author$project$Gallery$Parent$TryOn(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Gallery$Parent$TryOnMsg, cmds)); }; var $elm$core$List$any = F2( function (isOkay, list) { @@ -12147,29 +13113,31 @@ var $elm$core$List$all = F2( list); }); var $author$project$Gallery$Hanoi$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Gallery$Hanoi$system.b9, msg, model.aa, model.O); - var dnd = _v1.a; - var disks = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Gallery$Hanoi$system.cq, model.P, dndMsg, model.Z); + var disks = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var solved = A2( $elm$core$List$all, function (disk) { - return disk.a1 === 'transparent'; + return disk.bb === 'transparent'; }, A2($elm$core$List$take, 3, disks)); return _Utils_Tuple2( _Utils_update( model, - {O: disks, aa: dnd, aL: solved}), - $author$project$Gallery$Hanoi$system.cM(dnd)); + {P: disks, Z: dndModel, aP: solved}), + dndCmd); }); var $author$project$Gallery$Knight$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Gallery$Knight$system.b9, msg, model.aa, model.az); - var dnd = _v1.a; - var squares = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Gallery$Knight$system.cq, model.aB, dndMsg, model.Z); + var squares = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; var solved = $elm$core$List$length( A2( $elm$core$List$filter, @@ -12180,30 +13148,30 @@ var $author$project$Gallery$Knight$update = F2( return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, aL: solved, az: squares}), - $author$project$Gallery$Knight$system.cM(dnd)); + {Z: dndModel, aP: solved, aB: squares}), + dndCmd); }); var $elm$core$Basics$modBy = _Basics_modBy; var $elm$core$List$sortBy = _List_sortBy; var $author$project$Gallery$Puzzle$update = F2( - function (message, model) { - if (!message.$) { - var shuffled = message.a; + function (msg, model) { + if (!msg.$) { + var shuffled = msg.a; return _Utils_Tuple2( _Utils_update( model, { - au: A2( + av: A2( $elm$core$List$sortBy, function ($) { - return $.t; + return $.x; }, A2( $elm$core$List$indexedMap, F2( function (i, _v1) { - var value = _v1.aB; - var color = _v1.aV; + var value = _v1.aC; + var color = _v1.a_; var _v2 = A2($elm$core$Basics$modBy, 4, i); switch (_v2) { case 0: @@ -12222,28 +13190,30 @@ var $author$project$Gallery$Puzzle$update = F2( }), $elm$core$Platform$Cmd$none); } else { - var msg = message.a; - var _v3 = A3($author$project$Gallery$Puzzle$system.b9, msg, model.aa, model.au); - var dnd = _v3.a; - var items = _v3.b; + var dndMsg = msg.a; + var _v3 = A3($author$project$Gallery$Puzzle$system.cq, model.av, dndMsg, model.Z); + var items = _v3.a; + var dndModel = _v3.b; + var dndCmd = _v3.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Gallery$Puzzle$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } }); var $author$project$Gallery$Shapes$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Gallery$Shapes$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Gallery$Shapes$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Gallery$Shapes$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); var $author$project$Gallery$TaskBoard$gatherByActivity = function (cards) { return A3( @@ -12262,7 +13232,7 @@ var $author$project$Gallery$TaskBoard$gatherByActivity = function (cards) { var y = _v1.a; var restOfGroup = _v1.b; var groups = acc.b; - return _Utils_eq(x.r, y.r) ? A2( + return _Utils_eq(x.t, y.t) ? A2( $elm$core$List$cons, A2( $elm$core$List$cons, @@ -12282,49 +13252,52 @@ var $author$project$Gallery$TaskBoard$gatherByActivity = function (cards) { cards); }; var $author$project$Gallery$TaskBoard$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Gallery$TaskBoard$cardSystem.b9, msg, model.K, model.C); - var cardDnD = _v1.a; - var cards = _v1.b; + function (msg, model) { + if (!msg.$) { + var cardMovedMsg = msg.a; + var _v1 = A3($author$project$Gallery$TaskBoard$cardSystem.cq, model.D, cardMovedMsg, model.K); + var cards = _v1.a; + var cardDnDModel = _v1.b; + var cardCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {K: cardDnD, C: cards}), - $author$project$Gallery$TaskBoard$cardSystem.cM(cardDnD)); + {K: cardDnDModel, D: cards}), + cardCmd); } else { - var msg = message.a; + var columnMovedMsg = msg.a; var _v2 = A3( - $author$project$Gallery$TaskBoard$columnSystem.b9, - msg, - model.M, - $author$project$Gallery$TaskBoard$gatherByActivity(model.C)); - var columnDnD = _v2.a; - var columns = _v2.b; + $author$project$Gallery$TaskBoard$columnSystem.cq, + $author$project$Gallery$TaskBoard$gatherByActivity(model.D), + columnMovedMsg, + model.M); + var columns = _v2.a; + var columnDnDModel = _v2.b; + var columnCmd = _v2.c; return _Utils_Tuple2( _Utils_update( model, { - C: $elm$core$List$concat(columns), - M: columnDnD + D: $elm$core$List$concat(columns), + M: columnDnDModel }), - $author$project$Gallery$TaskBoard$columnSystem.cM(columnDnD)); + columnCmd); } }); var $author$project$Gallery$TryOn$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Gallery$TryOn$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Gallery$TryOn$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Gallery$TryOn$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); -var $author$project$Gallery$Root$update = F2( +var $author$project$Gallery$Parent$update = F2( function (message, model) { var _v0 = _Utils_Tuple2(message, model); _v0$6: @@ -12334,7 +13307,7 @@ var $author$project$Gallery$Root$update = F2( if (!_v0.b.$) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Gallery$Root$stepHanoi( + return $author$project$Gallery$Parent$stepHanoi( A2($author$project$Gallery$Hanoi$update, msg, mo)); } else { break _v0$6; @@ -12343,7 +13316,7 @@ var $author$project$Gallery$Root$update = F2( if (_v0.b.$ === 1) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Gallery$Root$stepPuzzle( + return $author$project$Gallery$Parent$stepPuzzle( A2($author$project$Gallery$Puzzle$update, msg, mo)); } else { break _v0$6; @@ -12352,7 +13325,7 @@ var $author$project$Gallery$Root$update = F2( if (_v0.b.$ === 2) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Gallery$Root$stepShapes( + return $author$project$Gallery$Parent$stepShapes( A2($author$project$Gallery$Shapes$update, msg, mo)); } else { break _v0$6; @@ -12361,7 +13334,7 @@ var $author$project$Gallery$Root$update = F2( if (_v0.b.$ === 3) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Gallery$Root$stepKnight( + return $author$project$Gallery$Parent$stepKnight( A2($author$project$Gallery$Knight$update, msg, mo)); } else { break _v0$6; @@ -12370,7 +13343,7 @@ var $author$project$Gallery$Root$update = F2( if (_v0.b.$ === 4) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Gallery$Root$stepTryOn( + return $author$project$Gallery$Parent$stepTryOn( A2($author$project$Gallery$TryOn$update, msg, mo)); } else { break _v0$6; @@ -12379,7 +13352,7 @@ var $author$project$Gallery$Root$update = F2( if (_v0.b.$ === 5) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Gallery$Root$stepTaskBoard( + return $author$project$Gallery$Parent$stepTaskBoard( A2($author$project$Gallery$TaskBoard$update, msg, mo)); } else { break _v0$6; @@ -12392,178 +13365,186 @@ var $author$project$Home$update = F2( function (message, model) { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); }); -var $author$project$Introduction$Root$stepBasic = function (_v0) { +var $author$project$Introduction$Parent$stepBasic = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Basic(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$BasicMsg, cmds)); + $author$project$Introduction$Parent$Basic(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$BasicMsg, cmds)); }; -var $author$project$Introduction$Root$stepBasicElmUI = function (_v0) { +var $author$project$Introduction$Parent$stepBasicElmUI = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$BasicElmUI(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$BasicElmUIMsg, cmds)); + $author$project$Introduction$Parent$BasicElmUI(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$BasicElmUIMsg, cmds)); }; -var $author$project$Introduction$Root$stepGroups = function (_v0) { +var $author$project$Introduction$Parent$stepGroups = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Groups(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$GroupsMsg, cmds)); + $author$project$Introduction$Parent$Groups(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$GroupsMsg, cmds)); }; -var $author$project$Introduction$Root$stepHandle = function (_v0) { +var $author$project$Introduction$Parent$stepHandle = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Handle(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$HandleMsg, cmds)); + $author$project$Introduction$Parent$Handle(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$HandleMsg, cmds)); }; -var $author$project$Introduction$Root$stepIndependents = function (_v0) { +var $author$project$Introduction$Parent$stepIndependents = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Independents(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$IndependentsMsg, cmds)); + $author$project$Introduction$Parent$Independents(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$IndependentsMsg, cmds)); }; -var $author$project$Introduction$Root$stepKeyed = function (_v0) { +var $author$project$Introduction$Parent$stepKeyed = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Keyed(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$KeyedMsg, cmds)); + $author$project$Introduction$Parent$Keyed(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$KeyedMsg, cmds)); }; -var $author$project$Introduction$Root$stepMargins = function (_v0) { +var $author$project$Introduction$Parent$stepMargins = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Margins(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$MarginsMsg, cmds)); + $author$project$Introduction$Parent$Margins(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$MarginsMsg, cmds)); }; -var $author$project$Introduction$Root$stepMasonry = function (_v0) { +var $author$project$Introduction$Parent$stepMasonry = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Masonry(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$MasonryMsg, cmds)); + $author$project$Introduction$Parent$Masonry(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$MasonryMsg, cmds)); }; -var $author$project$Introduction$Root$stepResize = function (_v0) { +var $author$project$Introduction$Parent$stepResize = function (_v0) { var mo = _v0.a; var cmds = _v0.b; return _Utils_Tuple2( - $author$project$Introduction$Root$Resize(mo), - A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Root$ResizeMsg, cmds)); + $author$project$Introduction$Parent$Resize(mo), + A2($elm$core$Platform$Cmd$map, $author$project$Introduction$Parent$ResizeMsg, cmds)); }; var $author$project$Introduction$Basic$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$Basic$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$Basic$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Introduction$Basic$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); var $author$project$Introduction$BasicElmUI$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$BasicElmUI$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$BasicElmUI$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Introduction$BasicElmUI$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); var $author$project$Introduction$Groups$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$Groups$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$Groups$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Introduction$Groups$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); var $author$project$Introduction$Handle$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$Handle$system.b9, msg, model.aa, model.as); - var dnd = _v1.a; - var fruits = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$Handle$system.cq, model.au, dndMsg, model.Z); + var fruits = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, as: fruits}), - $author$project$Introduction$Handle$system.cM(dnd)); + {Z: dndModel, au: fruits}), + dndCmd); }); var $author$project$Introduction$Independents$update = F2( - function (message, model) { - if (!message.$) { - var msg = message.a; - var _v1 = A3($author$project$Introduction$Independents$redSystem.b9, msg, model.aj, model.aw); - var redDnD = _v1.a; - var reds = _v1.b; + function (msg, model) { + if (!msg.$) { + var redMsg = msg.a; + var _v1 = A3($author$project$Introduction$Independents$redSystem.cq, model.ax, redMsg, model.ag); + var reds = _v1.a; + var redDnDModel = _v1.b; + var redCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aj: redDnD, aw: reds}), - $author$project$Introduction$Independents$redSystem.cM(redDnD)); + {ag: redDnDModel, ax: reds}), + redCmd); } else { - var msg = message.a; - var _v2 = A3($author$project$Introduction$Independents$blueSystem.b9, msg, model.Y, model.an); - var blueDnD = _v2.a; - var blues = _v2.b; + var blueMsg = msg.a; + var _v2 = A3($author$project$Introduction$Independents$blueSystem.cq, model.am, blueMsg, model.W); + var blues = _v2.a; + var blueDnDModel = _v2.b; + var blueCmd = _v2.c; return _Utils_Tuple2( _Utils_update( model, - {Y: blueDnD, an: blues}), - $author$project$Introduction$Independents$blueSystem.cM(blueDnD)); + {W: blueDnDModel, am: blues}), + blueCmd); } }); var $author$project$Introduction$Keyed$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$Keyed$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$Keyed$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Introduction$Keyed$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); var $author$project$Introduction$Margins$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$Margins$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$Margins$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Introduction$Margins$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); }); var $author$project$Introduction$Masonry$Item = F2( function (a, b) { return {$: 0, a: a, b: b}; }); -var $author$project$Introduction$Masonry$update = F2( - function (message, model) { - if (!message.$) { - var widths = message.a; +var $author$project$Introduction$Masonry$update = F2( + function (msg, model) { + if (!msg.$) { + var widths = msg.a; return _Utils_Tuple2( _Utils_update( model, { - au: A3( + av: A3( $elm$core$List$map2, F2( function (color, width) { @@ -12574,30 +13555,32 @@ var $author$project$Introduction$Masonry$update = F2( }), $elm$core$Platform$Cmd$none); } else { - var msg = message.a; - var _v1 = A3($author$project$Introduction$Masonry$system.b9, msg, model.aa, model.au); - var dnd = _v1.a; - var items = _v1.b; + var dndMsg = msg.a; + var _v1 = A3($author$project$Introduction$Masonry$system.cq, model.av, dndMsg, model.Z); + var items = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {aa: dnd, au: items}), - $author$project$Introduction$Masonry$system.cM(dnd)); + {Z: dndModel, av: items}), + dndCmd); } }); var $author$project$Introduction$Resize$update = F2( - function (message, model) { - var msg = message; - var _v1 = A3($author$project$Introduction$Resize$system.b9, msg, model.aa, model.ap); - var dnd = _v1.a; - var colors = _v1.b; + function (msg, model) { + var dndMsg = msg; + var _v1 = A3($author$project$Introduction$Resize$system.cq, model.ao, dndMsg, model.Z); + var colors = _v1.a; + var dndModel = _v1.b; + var dndCmd = _v1.c; return _Utils_Tuple2( _Utils_update( model, - {ap: colors, aa: dnd}), - $author$project$Introduction$Resize$system.cM(dnd)); + {ao: colors, Z: dndModel}), + dndCmd); }); -var $author$project$Introduction$Root$update = F2( +var $author$project$Introduction$Parent$update = F2( function (message, model) { var _v0 = _Utils_Tuple2(message, model); _v0$9: @@ -12607,7 +13590,7 @@ var $author$project$Introduction$Root$update = F2( if (!_v0.b.$) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepBasic( + return $author$project$Introduction$Parent$stepBasic( A2($author$project$Introduction$Basic$update, msg, mo)); } else { break _v0$9; @@ -12616,7 +13599,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 1) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepBasicElmUI( + return $author$project$Introduction$Parent$stepBasicElmUI( A2($author$project$Introduction$BasicElmUI$update, msg, mo)); } else { break _v0$9; @@ -12625,7 +13608,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 2) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepHandle( + return $author$project$Introduction$Parent$stepHandle( A2($author$project$Introduction$Handle$update, msg, mo)); } else { break _v0$9; @@ -12634,7 +13617,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 3) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepKeyed( + return $author$project$Introduction$Parent$stepKeyed( A2($author$project$Introduction$Keyed$update, msg, mo)); } else { break _v0$9; @@ -12643,7 +13626,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 4) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepMargins( + return $author$project$Introduction$Parent$stepMargins( A2($author$project$Introduction$Margins$update, msg, mo)); } else { break _v0$9; @@ -12652,7 +13635,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 5) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepMasonry( + return $author$project$Introduction$Parent$stepMasonry( A2($author$project$Introduction$Masonry$update, msg, mo)); } else { break _v0$9; @@ -12661,7 +13644,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 6) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepResize( + return $author$project$Introduction$Parent$stepResize( A2($author$project$Introduction$Resize$update, msg, mo)); } else { break _v0$9; @@ -12670,7 +13653,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 7) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepIndependents( + return $author$project$Introduction$Parent$stepIndependents( A2($author$project$Introduction$Independents$update, msg, mo)); } else { break _v0$9; @@ -12679,7 +13662,7 @@ var $author$project$Introduction$Root$update = F2( if (_v0.b.$ === 8) { var msg = _v0.a.a; var mo = _v0.b.a; - return $author$project$Introduction$Root$stepGroups( + return $author$project$Introduction$Parent$stepGroups( A2($author$project$Introduction$Groups$update, msg, mo)); } else { break _v0$9; @@ -12690,7 +13673,7 @@ var $author$project$Introduction$Root$update = F2( }); var $author$project$Main$update = F2( function (message, model) { - var _v0 = _Utils_Tuple2(message, model.s); + var _v0 = _Utils_Tuple2(message, model.u); _v0$8: while (true) { switch (_v0.a.$) { @@ -12705,14 +13688,14 @@ var $author$project$Main$update = F2( _Utils_update( model, { - z: $author$project$Main$toPath(url) + A: $author$project$Main$toPath(url) }), $elm$core$Platform$Cmd$batch( _List_fromArray( [ A2( $elm$browser$Browser$Navigation$pushUrl, - model.bf, + model.bo, $elm$url$Url$toString(url)), $author$project$Main$jumpToTop('main') ]))); @@ -12743,7 +13726,7 @@ var $author$project$Main$update = F2( return A2( $author$project$Main$stepIntroduction, model, - A2($author$project$Introduction$Root$update, msg, mo)); + A2($author$project$Introduction$Parent$update, msg, mo)); } else { break _v0$8; } @@ -12754,7 +13737,7 @@ var $author$project$Main$update = F2( return A2( $author$project$Main$stepConfig, model, - A2($author$project$Config$Root$update, msg, mo)); + A2($author$project$DnDList$Parent$update, msg, mo)); } else { break _v0$8; } @@ -12765,7 +13748,7 @@ var $author$project$Main$update = F2( return A2( $author$project$Main$stepConfigGroups, model, - A2($author$project$ConfigGroups$Root$update, msg, mo)); + A2($author$project$DnDListGroups$Parent$update, msg, mo)); } else { break _v0$8; } @@ -12776,7 +13759,7 @@ var $author$project$Main$update = F2( return A2( $author$project$Main$stepGallery, model, - A2($author$project$Gallery$Root$update, msg, mo)); + A2($author$project$Gallery$Parent$update, msg, mo)); } else { break _v0$8; } @@ -12889,7 +13872,7 @@ var $author$project$CustomElement$href = function (url) { 'href', $elm$json$Json$Encode$string(url)); }; -var $author$project$Config$Root$toCode = function (url) { +var $author$project$DnDList$Parent$toCode = function (url) { return A2( $author$project$CustomElement$elmCode, _List_fromArray( @@ -12898,73 +13881,87 @@ var $author$project$Config$Root$toCode = function (url) { ]), _List_Nil); }; -var $author$project$Config$Movement$Root$url = function (id) { +var $author$project$DnDList$HookCommands$Parent$url = function (id) { + switch (id) { + case 0: + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/HookCommands/DetectDrop.elm'; + case 1: + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/HookCommands/DetectReorder.elm'; + default: + return ''; + } +}; +var $author$project$DnDList$Movement$Parent$url = function (id) { switch (id) { case 0: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/FreeOnDrag.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Movement/FreeOnDrag.elm'; case 1: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/FreeOnDrop.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Movement/FreeOnDrop.elm'; case 2: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/HorizontalOnDrag.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Movement/HorizontalOnDrag.elm'; case 3: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/HorizontalOnDrop.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Movement/HorizontalOnDrop.elm'; case 4: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/VerticalOnDrag.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Movement/VerticalOnDrag.elm'; case 5: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/VerticalOnDrop.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Movement/VerticalOnDrop.elm'; default: return ''; } }; -var $author$project$Config$OperationsOnDrag$Root$url = function (id) { +var $author$project$DnDList$OperationsOnDrag$Parent$url = function (id) { switch (id) { case 0: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/InsertAfter.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrag/DetectReorder.elm'; case 1: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/InsertBefore.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrag/InsertBefore.elm'; case 2: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/Rotate.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrag/Rotate.elm'; case 3: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/Swap.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrag/DetectReorder.elm'; case 4: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/Unaltered.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrag/Unaltered.elm'; default: return ''; } }; -var $author$project$Config$OperationsOnDrop$Root$url = function (id) { +var $author$project$DnDList$OperationsOnDrop$Parent$url = function (id) { switch (id) { case 0: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/InsertAfter.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrop/DetectReorder.elm'; case 1: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/InsertBefore.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrop/InsertBefore.elm'; case 2: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/Rotate.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrop/Rotate.elm'; case 3: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/Swap.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrop/DetectReorder.elm'; case 4: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/Unaltered.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/OperationsOnDrop/Unaltered.elm'; default: return ''; } }; -var $author$project$Config$Root$codeView = function (model) { +var $author$project$DnDList$Parent$codeView = function (model) { switch (model.$) { case 0: var mo = model.a; - return $author$project$Config$Root$toCode( - $author$project$Config$Movement$Root$url(mo.at)); + return $author$project$DnDList$Parent$toCode( + $author$project$DnDList$Movement$Parent$url(mo.a7)); case 1: var mo = model.a; - return $author$project$Config$Root$toCode( - $author$project$Config$OperationsOnDrag$Root$url(mo.at)); + return $author$project$DnDList$Parent$toCode( + $author$project$DnDList$OperationsOnDrag$Parent$url(mo.a7)); + case 2: + var mo = model.a; + return $author$project$DnDList$Parent$toCode( + $author$project$DnDList$OperationsOnDrop$Parent$url(mo.a7)); default: var mo = model.a; - return $author$project$Config$Root$toCode( - $author$project$Config$OperationsOnDrop$Root$url(mo.at)); + return $author$project$DnDList$Parent$toCode( + $author$project$DnDList$HookCommands$Parent$url(mo.a7)); } }; -var $author$project$ConfigGroups$Root$toCode = function (url) { +var $author$project$DnDListGroups$Parent$toCode = function (url) { return A2( $author$project$CustomElement$elmCode, _List_fromArray( @@ -12973,46 +13970,61 @@ var $author$project$ConfigGroups$Root$toCode = function (url) { ]), _List_Nil); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$url = function (id) { +var $author$project$DnDListGroups$HookCommands$Parent$url = function (id) { + switch (id) { + case 0: + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/HookCommands/DetectDrop.elm'; + case 1: + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/HookCommands/DetectReorder.elm'; + default: + return ''; + } +}; +var $author$project$DnDListGroups$OperationsOnDrag$Parent$url = function (id) { switch (id) { case 0: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/InsertAfter.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrag/DetectReorder.elm'; case 1: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/InsertBefore.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrag/InsertBefore.elm'; case 2: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/Rotate.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrag/Rotate.elm'; case 3: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/Swap.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrag/DetectReorder.elm'; default: return ''; } }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$url = function (id) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$url = function (id) { switch (id) { case 0: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/InsertAfter.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrop/DetectReorder.elm'; case 1: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/InsertBefore.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrop/InsertBefore.elm'; case 2: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/Rotate.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrop/Rotate.elm'; case 3: - return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/Swap.elm'; + return 'https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDListGroups/OperationsOnDrop/DetectReorder.elm'; default: return ''; } }; -var $author$project$ConfigGroups$Root$codeView = function (model) { - if (!model.$) { - var mo = model.a; - return $author$project$ConfigGroups$Root$toCode( - $author$project$ConfigGroups$OperationsOnDrag$Root$url(mo.at)); - } else { - var mo = model.a; - return $author$project$ConfigGroups$Root$toCode( - $author$project$ConfigGroups$OperationsOnDrop$Root$url(mo.at)); +var $author$project$DnDListGroups$Parent$codeView = function (model) { + switch (model.$) { + case 0: + var mo = model.a; + return $author$project$DnDListGroups$Parent$toCode( + $author$project$DnDListGroups$OperationsOnDrag$Parent$url(mo.a7)); + case 1: + var mo = model.a; + return $author$project$DnDListGroups$Parent$toCode( + $author$project$DnDListGroups$OperationsOnDrop$Parent$url(mo.a7)); + default: + var mo = model.a; + return $author$project$DnDListGroups$Parent$toCode( + $author$project$DnDListGroups$HookCommands$Parent$url(mo.a7)); } }; -var $author$project$Gallery$Root$toCode = function (url) { +var $author$project$Gallery$Parent$toCode = function (url) { return A2( $author$project$CustomElement$elmCode, _List_fromArray( @@ -13021,23 +14033,23 @@ var $author$project$Gallery$Root$toCode = function (url) { ]), _List_Nil); }; -var $author$project$Gallery$Root$codeView = function (model) { +var $author$project$Gallery$Parent$codeView = function (model) { switch (model.$) { case 0: - return $author$project$Gallery$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Hanoi.elm'); + return $author$project$Gallery$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Hanoi.elm'); case 1: - return $author$project$Gallery$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Puzzle.elm'); + return $author$project$Gallery$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Puzzle.elm'); case 2: - return $author$project$Gallery$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Shapes.elm'); + return $author$project$Gallery$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Shapes.elm'); case 3: - return $author$project$Gallery$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Knight.elm'); + return $author$project$Gallery$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Knight.elm'); case 4: - return $author$project$Gallery$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TryOn.elm'); + return $author$project$Gallery$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TryOn.elm'); default: - return $author$project$Gallery$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TaskBoard.elm'); + return $author$project$Gallery$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TaskBoard.elm'); } }; -var $author$project$Introduction$Root$toCode = function (url) { +var $author$project$Introduction$Parent$toCode = function (url) { return A2( $author$project$CustomElement$elmCode, _List_fromArray( @@ -13046,50 +14058,412 @@ var $author$project$Introduction$Root$toCode = function (url) { ]), _List_Nil); }; -var $author$project$Introduction$Root$codeView = function (model) { +var $author$project$Introduction$Parent$codeView = function (model) { switch (model.$) { case 0: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Basic.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Basic.elm'); case 1: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/BasicElmUI.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/BasicElmUI.elm'); case 2: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Handle.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Handle.elm'); case 3: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Keyed.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Keyed.elm'); case 4: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Margins.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Margins.elm'); case 5: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Masonry.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Masonry.elm'); case 6: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Resize.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Resize.elm'); case 7: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Independents.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Independents.elm'); default: - return $author$project$Introduction$Root$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Groups.elm'); + return $author$project$Introduction$Parent$toCode('https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Groups.elm'); + } +}; +var $elm$virtual_dom$VirtualDom$map = _VirtualDom_map; +var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; +var $author$project$DnDList$HookCommands$Parent$LinkClicked = function (a) { + return {$: 0, a: a}; +}; +var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); +var $elm$core$Tuple$second = function (_v0) { + var y = _v0.b; + return y; +}; +var $elm$html$Html$Attributes$classList = function (classes) { + return $elm$html$Html$Attributes$class( + A2( + $elm$core$String$join, + ' ', + A2( + $elm$core$List$map, + $elm$core$Tuple$first, + A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); +}; +var $author$project$DnDList$HookCommands$DetectDrop$containerStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-direction', 'column') + ]); +var $author$project$DnDList$HookCommands$DetectDrop$ghostStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa') + ]); +var $author$project$DnDList$HookCommands$DetectDrop$itemStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d'), + A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), + A2($elm$html$Html$Attributes$style, 'color', 'white'), + A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), + A2($elm$html$Html$Attributes$style, 'font-size', '1.2em'), + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'align-items', 'center'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'margin', '0 1.5em 1.5em 0'), + A2($elm$html$Html$Attributes$style, 'width', '50px'), + A2($elm$html$Html$Attributes$style, 'height', '50px') + ]); +var $author$project$DnDList$HookCommands$DetectDrop$ghostView = F2( + function (dnd, items) { + var maybeDragItem = A2( + $elm$core$Maybe$andThen, + function (_v1) { + var dragIndex = _v1.c; + return $elm$core$List$head( + A2($elm$core$List$drop, dragIndex, items)); + }, + $author$project$DnDList$HookCommands$DetectDrop$system.bX(dnd)); + if (!maybeDragItem.$) { + var item = maybeDragItem.a; + return A2( + $elm$html$Html$div, + _Utils_ap( + $author$project$DnDList$HookCommands$DetectDrop$itemStyles, + _Utils_ap( + $author$project$DnDList$HookCommands$DetectDrop$ghostStyles, + $author$project$DnDList$HookCommands$DetectDrop$system.bS(dnd))), + _List_fromArray( + [ + $elm$html$Html$text(item) + ])); + } else { + return $elm$html$Html$text(''); + } + }); +var $author$project$DnDList$HookCommands$DetectDrop$historyStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'list-style', 'none'), + A2($elm$html$Html$Attributes$style, 'width', '100px'), + A2($elm$html$Html$Attributes$style, 'font-family', 'monospace') + ]); +var $elm$html$Html$li = _VirtualDom_node('li'); +var $elm$html$Html$ul = _VirtualDom_node('ul'); +var $author$project$DnDList$HookCommands$DetectDrop$historyView = function (history) { + var eventView = function (_v0) { + var i = _v0.a; + var j = _v0.b; + return A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text( + $elm$core$String$fromInt(i) + (' ⟷ ' + $elm$core$String$fromInt(j))) + ])); + }; + return A2( + $elm$html$Html$ul, + $author$project$DnDList$HookCommands$DetectDrop$historyStyles, + A2( + $elm$core$List$cons, + A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text('i ⟷ j') + ])), + A2($elm$core$List$map, eventView, history))); +}; +var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); +var $author$project$DnDList$HookCommands$DetectDrop$placeholderStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') + ]); +var $author$project$DnDList$HookCommands$DetectDrop$itemView = F3( + function (dnd, index, item) { + var itemId = 'dropdrop-' + item; + var attrs = A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDList$HookCommands$DetectDrop$itemStyles); + var _v0 = $author$project$DnDList$HookCommands$DetectDrop$system.bX(dnd); + if (!_v0.$) { + var dragIndex = _v0.a.c; + return (!_Utils_eq(dragIndex, index)) ? A2( + $elm$html$Html$div, + _Utils_ap( + attrs, + A2($author$project$DnDList$HookCommands$DetectDrop$system.bM, index, itemId)), + _List_fromArray( + [ + $elm$html$Html$text(item) + ])) : A2( + $elm$html$Html$div, + _Utils_ap(attrs, $author$project$DnDList$HookCommands$DetectDrop$placeholderStyles), + _List_Nil); + } else { + return A2( + $elm$html$Html$div, + _Utils_ap( + attrs, + A2($author$project$DnDList$HookCommands$DetectDrop$system.bL, index, itemId)), + _List_fromArray( + [ + $elm$html$Html$text(item) + ])); + } + }); +var $elm$html$Html$section = _VirtualDom_node('section'); +var $author$project$DnDList$HookCommands$DetectDrop$view = function (model) { + return A2( + $elm$html$Html$section, + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex') + ]), + _List_fromArray( + [ + $author$project$DnDList$HookCommands$DetectDrop$historyView(model.aK), + A2( + $elm$html$Html$div, + $author$project$DnDList$HookCommands$DetectDrop$containerStyles, + A2( + $elm$core$List$indexedMap, + $author$project$DnDList$HookCommands$DetectDrop$itemView(model.Z), + model.av)), + A2($author$project$DnDList$HookCommands$DetectDrop$ghostView, model.Z, model.av) + ])); +}; +var $author$project$DnDList$HookCommands$DetectReorder$containerStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-direction', 'column') + ]); +var $author$project$DnDList$HookCommands$DetectReorder$ghostStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa') + ]); +var $author$project$DnDList$HookCommands$DetectReorder$itemStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d'), + A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), + A2($elm$html$Html$Attributes$style, 'color', 'white'), + A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), + A2($elm$html$Html$Attributes$style, 'font-size', '1.2em'), + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'align-items', 'center'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'margin', '0 1.5em 1.5em 0'), + A2($elm$html$Html$Attributes$style, 'width', '50px'), + A2($elm$html$Html$Attributes$style, 'height', '50px') + ]); +var $author$project$DnDList$HookCommands$DetectReorder$ghostView = F2( + function (dnd, items) { + var maybeDragItem = A2( + $elm$core$Maybe$andThen, + function (_v1) { + var dragIndex = _v1.c; + return $elm$core$List$head( + A2($elm$core$List$drop, dragIndex, items)); + }, + $author$project$DnDList$HookCommands$DetectReorder$system.bX(dnd)); + if (!maybeDragItem.$) { + var item = maybeDragItem.a; + return A2( + $elm$html$Html$div, + _Utils_ap( + $author$project$DnDList$HookCommands$DetectReorder$itemStyles, + _Utils_ap( + $author$project$DnDList$HookCommands$DetectReorder$ghostStyles, + $author$project$DnDList$HookCommands$DetectReorder$system.bS(dnd))), + _List_fromArray( + [ + $elm$html$Html$text(item) + ])); + } else { + return $elm$html$Html$text(''); + } + }); +var $author$project$DnDList$HookCommands$DetectReorder$historyStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'list-style', 'none'), + A2($elm$html$Html$Attributes$style, 'width', '100px'), + A2($elm$html$Html$Attributes$style, 'font-family', 'monospace') + ]); +var $author$project$DnDList$HookCommands$DetectReorder$historyView = function (history) { + var eventView = function (_v0) { + var i = _v0.a; + var j = _v0.b; + return A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text( + $elm$core$String$fromInt(i) + (' ⟷ ' + $elm$core$String$fromInt(j))) + ])); + }; + return A2( + $elm$html$Html$ul, + $author$project$DnDList$HookCommands$DetectReorder$historyStyles, + A2( + $elm$core$List$cons, + A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text('i ⟷ j') + ])), + A2($elm$core$List$map, eventView, history))); +}; +var $author$project$DnDList$HookCommands$DetectReorder$placeholderStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') + ]); +var $author$project$DnDList$HookCommands$DetectReorder$itemView = F3( + function (dnd, index, item) { + var itemId = 'dragdrag-' + item; + var attrs = A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDList$HookCommands$DetectReorder$itemStyles); + var _v0 = $author$project$DnDList$HookCommands$DetectReorder$system.bX(dnd); + if (!_v0.$) { + var dragIndex = _v0.a.c; + return (!_Utils_eq(dragIndex, index)) ? A2( + $elm$html$Html$div, + _Utils_ap( + attrs, + A2($author$project$DnDList$HookCommands$DetectReorder$system.bM, index, itemId)), + _List_fromArray( + [ + $elm$html$Html$text(item) + ])) : A2( + $elm$html$Html$div, + _Utils_ap(attrs, $author$project$DnDList$HookCommands$DetectReorder$placeholderStyles), + _List_Nil); + } else { + return A2( + $elm$html$Html$div, + _Utils_ap( + attrs, + A2($author$project$DnDList$HookCommands$DetectReorder$system.bL, index, itemId)), + _List_fromArray( + [ + $elm$html$Html$text(item) + ])); + } + }); +var $author$project$DnDList$HookCommands$DetectReorder$view = function (model) { + return A2( + $elm$html$Html$section, + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex') + ]), + _List_fromArray( + [ + $author$project$DnDList$HookCommands$DetectReorder$historyView(model.aK), + A2( + $elm$html$Html$div, + $author$project$DnDList$HookCommands$DetectReorder$containerStyles, + A2( + $elm$core$List$indexedMap, + $author$project$DnDList$HookCommands$DetectReorder$itemView(model.Z), + model.av)), + A2($author$project$DnDList$HookCommands$DetectReorder$ghostView, model.Z, model.av) + ])); +}; +var $author$project$DnDList$HookCommands$Parent$demoView = function (example) { + if (!example.$) { + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$HookCommands$Parent$DetectDropMsg, + $author$project$DnDList$HookCommands$DetectDrop$view(mo)); + } else { + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$HookCommands$Parent$DetectReorderMsg, + $author$project$DnDList$HookCommands$DetectReorder$view(mo)); } }; -var $elm$virtual_dom$VirtualDom$map = _VirtualDom_map; -var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; -var $author$project$Config$Movement$Root$LinkClicked = function (a) { - return {$: 0, a: a}; +var $author$project$DnDList$HookCommands$Parent$info = function (example) { + if (!example.$) { + return 'Detect drop'; + } else { + return 'Detect reorder'; + } }; -var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); -var $elm$core$Tuple$second = function (_v0) { - var y = _v0.b; - return y; +var $elm$html$Html$Events$onClick = function (msg) { + return A2( + $elm$html$Html$Events$on, + 'click', + $elm$json$Json$Decode$succeed(msg)); }; -var $elm$html$Html$Attributes$classList = function (classes) { - return $elm$html$Html$Attributes$class( +var $author$project$DnDList$HookCommands$Parent$demoWrapperView = F3( + function (currentId, id, example) { + return A2( + $elm$html$Html$div, + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'margin', '4em 0') + ]), + _List_fromArray( + [ + $author$project$DnDList$HookCommands$Parent$demoView(example), + A2( + $elm$html$Html$div, + _List_fromArray( + [ + $elm$html$Html$Attributes$classList( + _List_fromArray( + [ + _Utils_Tuple2('link', true), + _Utils_Tuple2( + 'is-active', + _Utils_eq(id, currentId)) + ])), + $elm$html$Html$Events$onClick( + $author$project$DnDList$HookCommands$Parent$LinkClicked(id)) + ]), + _List_fromArray( + [ + $elm$html$Html$text( + $author$project$DnDList$HookCommands$Parent$info(example)) + ])) + ])); + }); +var $author$project$DnDList$HookCommands$Parent$view = function (model) { + return A2( + $elm$html$Html$section, + _List_Nil, A2( - $elm$core$String$join, - ' ', - A2( - $elm$core$List$map, - $elm$core$Tuple$first, - A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); + $elm$core$List$indexedMap, + $author$project$DnDList$HookCommands$Parent$demoWrapperView(model.a7), + model.at)); +}; +var $author$project$DnDList$Movement$Parent$LinkClicked = function (a) { + return {$: 0, a: a}; }; -var $author$project$Config$Movement$FreeOnDrag$ClearAffected = {$: 1}; -var $author$project$Config$Movement$FreeOnDrag$containerStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrag$ClearAffected = {$: 1}; +var $author$project$DnDList$Movement$FreeOnDrag$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'grid'), A2($elm$html$Html$Attributes$style, 'grid-template-columns', '50px 50px 50px'), @@ -13097,11 +14471,11 @@ var $author$project$Config$Movement$FreeOnDrag$containerStyles = _List_fromArray A2($elm$html$Html$Attributes$style, 'grid-gap', '1em'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$Movement$FreeOnDrag$ghostStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrag$ghostStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa') ]); -var $author$project$Config$Movement$FreeOnDrag$itemStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrag$itemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d'), A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), @@ -13112,25 +14486,25 @@ var $author$project$Config$Movement$FreeOnDrag$itemStyles = _List_fromArray( A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$Movement$FreeOnDrag$ghostView = F2( +var $author$project$DnDList$Movement$FreeOnDrag$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$Movement$FreeOnDrag$system.be(dnd)); + $author$project$DnDList$Movement$FreeOnDrag$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$Movement$FreeOnDrag$itemStyles, + $author$project$DnDList$Movement$FreeOnDrag$itemStyles, _Utils_ap( - $author$project$Config$Movement$FreeOnDrag$ghostStyles, - $author$project$Config$Movement$FreeOnDrag$system.c$(dnd))), + $author$project$DnDList$Movement$FreeOnDrag$ghostStyles, + $author$project$DnDList$Movement$FreeOnDrag$system.bS(dnd))), _List_fromArray( [ $elm$html$Html$text(item) @@ -13139,11 +14513,10 @@ var $author$project$Config$Movement$FreeOnDrag$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$Movement$FreeOnDrag$affectedStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrag$affectedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#691361') ]); -var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); var $elm$core$List$member = F2( function (x, xs) { return A2( @@ -13153,40 +14526,40 @@ var $elm$core$List$member = F2( }, xs); }); -var $author$project$Config$Movement$FreeOnDrag$placeholderStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrag$placeholderStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') ]); -var $author$project$Config$Movement$FreeOnDrag$itemView = F4( +var $author$project$DnDList$Movement$FreeOnDrag$itemView = F4( function (dnd, affected, index, item) { var itemId = 'frdrag-' + item; var attrs = A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$Movement$FreeOnDrag$itemStyles, - A2($elm$core$List$member, index, affected) ? $author$project$Config$Movement$FreeOnDrag$affectedStyles : _List_Nil)); - var _v0 = $author$project$Config$Movement$FreeOnDrag$system.be(dnd); + $author$project$DnDList$Movement$FreeOnDrag$itemStyles, + A2($elm$core$List$member, index, affected) ? $author$project$DnDList$Movement$FreeOnDrag$affectedStyles : _List_Nil)); + var _v0 = $author$project$DnDList$Movement$FreeOnDrag$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$FreeOnDrag$system.cU, index, itemId)), + A2($author$project$DnDList$Movement$FreeOnDrag$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])) : A2( $elm$html$Html$div, - _Utils_ap(attrs, $author$project$Config$Movement$FreeOnDrag$placeholderStyles), + _Utils_ap(attrs, $author$project$DnDList$Movement$FreeOnDrag$placeholderStyles), _List_Nil); } else { return A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$FreeOnDrag$system.cT, index, itemId)), + A2($author$project$DnDList$Movement$FreeOnDrag$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) @@ -13199,28 +14572,27 @@ var $elm$html$Html$Events$onMouseDown = function (msg) { 'mousedown', $elm$json$Json$Decode$succeed(msg)); }; -var $elm$html$Html$section = _VirtualDom_node('section'); -var $author$project$Config$Movement$FreeOnDrag$view = function (model) { +var $author$project$DnDList$Movement$FreeOnDrag$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$Movement$FreeOnDrag$ClearAffected) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$Movement$FreeOnDrag$ClearAffected) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$Movement$FreeOnDrag$containerStyles, + $author$project$DnDList$Movement$FreeOnDrag$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$FreeOnDrag$itemView, model.aa, model.I), - model.au)), - A2($author$project$Config$Movement$FreeOnDrag$ghostView, model.aa, model.au) + A2($author$project$DnDList$Movement$FreeOnDrag$itemView, model.Z, model.I), + model.av)), + A2($author$project$DnDList$Movement$FreeOnDrag$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$Movement$FreeOnDrop$ClearAffected = {$: 1}; -var $author$project$Config$Movement$FreeOnDrop$containerStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrop$ClearAffected = {$: 1}; +var $author$project$DnDList$Movement$FreeOnDrop$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'grid'), A2($elm$html$Html$Attributes$style, 'grid-template-columns', '50px 50px 50px'), @@ -13228,11 +14600,11 @@ var $author$project$Config$Movement$FreeOnDrop$containerStyles = _List_fromArray A2($elm$html$Html$Attributes$style, 'grid-gap', '1em'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$Movement$FreeOnDrop$ghostStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrop$ghostStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d') ]); -var $author$project$Config$Movement$FreeOnDrop$itemStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrop$itemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa'), A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), @@ -13243,25 +14615,25 @@ var $author$project$Config$Movement$FreeOnDrop$itemStyles = _List_fromArray( A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$Movement$FreeOnDrop$ghostView = F2( +var $author$project$DnDList$Movement$FreeOnDrop$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$Movement$FreeOnDrop$system.be(dnd)); + $author$project$DnDList$Movement$FreeOnDrop$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$Movement$FreeOnDrop$itemStyles, + $author$project$DnDList$Movement$FreeOnDrop$itemStyles, _Utils_ap( - $author$project$Config$Movement$FreeOnDrop$ghostStyles, - $author$project$Config$Movement$FreeOnDrop$system.c$(dnd))), + $author$project$DnDList$Movement$FreeOnDrop$ghostStyles, + $author$project$DnDList$Movement$FreeOnDrop$system.bS(dnd))), _List_fromArray( [ $elm$html$Html$text(item) @@ -13270,36 +14642,36 @@ var $author$project$Config$Movement$FreeOnDrop$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$Movement$FreeOnDrop$affectedStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrop$affectedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#136169') ]); -var $author$project$Config$Movement$FreeOnDrop$overedStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrop$overedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#63bdc7') ]); -var $author$project$Config$Movement$FreeOnDrop$placeholderStyles = _List_fromArray( +var $author$project$DnDList$Movement$FreeOnDrop$placeholderStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') ]); -var $author$project$Config$Movement$FreeOnDrop$itemView = F4( +var $author$project$DnDList$Movement$FreeOnDrop$itemView = F4( function (dnd, affected, index, item) { var itemId = 'frdrop-' + item; var attrs = A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$Movement$FreeOnDrop$itemStyles, - A2($elm$core$List$member, index, affected) ? $author$project$Config$Movement$FreeOnDrop$affectedStyles : _List_Nil)); - var _v0 = $author$project$Config$Movement$FreeOnDrop$system.be(dnd); + $author$project$DnDList$Movement$FreeOnDrop$itemStyles, + A2($elm$core$List$member, index, affected) ? $author$project$DnDList$Movement$FreeOnDrop$affectedStyles : _List_Nil)); + var _v0 = $author$project$DnDList$Movement$FreeOnDrop$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; - var dropIndex = _v0.a.cV; + var dragIndex = _v0.a.c; + var dropIndex = _v0.a.h; return ((!_Utils_eq(dragIndex, index)) && (!_Utils_eq(dropIndex, index))) ? A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$FreeOnDrop$system.cU, index, itemId)), + A2($author$project$DnDList$Movement$FreeOnDrop$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) @@ -13308,56 +14680,56 @@ var $author$project$Config$Movement$FreeOnDrop$itemView = F4( _Utils_ap( attrs, _Utils_ap( - $author$project$Config$Movement$FreeOnDrop$overedStyles, - A2($author$project$Config$Movement$FreeOnDrop$system.cU, index, itemId))), + $author$project$DnDList$Movement$FreeOnDrop$overedStyles, + A2($author$project$DnDList$Movement$FreeOnDrop$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) ])) : A2( $elm$html$Html$div, - _Utils_ap(attrs, $author$project$Config$Movement$FreeOnDrop$placeholderStyles), + _Utils_ap(attrs, $author$project$DnDList$Movement$FreeOnDrop$placeholderStyles), _List_Nil)); } else { return A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$FreeOnDrop$system.cT, index, itemId)), + A2($author$project$DnDList$Movement$FreeOnDrop$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])); } }); -var $author$project$Config$Movement$FreeOnDrop$view = function (model) { +var $author$project$DnDList$Movement$FreeOnDrop$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$Movement$FreeOnDrop$ClearAffected) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$Movement$FreeOnDrop$ClearAffected) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$Movement$FreeOnDrop$containerStyles, + $author$project$DnDList$Movement$FreeOnDrop$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$FreeOnDrop$itemView, model.aa, model.I), - model.au)), - A2($author$project$Config$Movement$FreeOnDrop$ghostView, model.aa, model.au) + A2($author$project$DnDList$Movement$FreeOnDrop$itemView, model.Z, model.I), + model.av)), + A2($author$project$DnDList$Movement$FreeOnDrop$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$Movement$HorizontalOnDrag$ClearAffected = {$: 1}; -var $author$project$Config$Movement$HorizontalOnDrag$containerStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrag$ClearAffected = {$: 1}; +var $author$project$DnDList$Movement$HorizontalOnDrag$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex') ]); -var $author$project$Config$Movement$HorizontalOnDrag$ghostStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrag$ghostStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa') ]); -var $author$project$Config$Movement$HorizontalOnDrag$itemStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrag$itemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d'), A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), @@ -13371,25 +14743,25 @@ var $author$project$Config$Movement$HorizontalOnDrag$itemStyles = _List_fromArra A2($elm$html$Html$Attributes$style, 'width', '50px'), A2($elm$html$Html$Attributes$style, 'height', '50px') ]); -var $author$project$Config$Movement$HorizontalOnDrag$ghostView = F2( +var $author$project$DnDList$Movement$HorizontalOnDrag$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$Movement$HorizontalOnDrag$system.be(dnd)); + $author$project$DnDList$Movement$HorizontalOnDrag$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrag$itemStyles, + $author$project$DnDList$Movement$HorizontalOnDrag$itemStyles, _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrag$ghostStyles, - $author$project$Config$Movement$HorizontalOnDrag$system.c$(dnd))), + $author$project$DnDList$Movement$HorizontalOnDrag$ghostStyles, + $author$project$DnDList$Movement$HorizontalOnDrag$system.bS(dnd))), _List_fromArray( [ $elm$html$Html$text(item) @@ -13398,79 +14770,79 @@ var $author$project$Config$Movement$HorizontalOnDrag$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$Movement$HorizontalOnDrag$affectedStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrag$affectedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#691361') ]); -var $author$project$Config$Movement$HorizontalOnDrag$placeholderStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrag$placeholderStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') ]); -var $author$project$Config$Movement$HorizontalOnDrag$itemView = F4( +var $author$project$DnDList$Movement$HorizontalOnDrag$itemView = F4( function (dnd, affected, index, item) { var itemId = 'hrdrag-' + item; var attrs = A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrag$itemStyles, - A2($elm$core$List$member, index, affected) ? $author$project$Config$Movement$HorizontalOnDrag$affectedStyles : _List_Nil)); - var _v0 = $author$project$Config$Movement$HorizontalOnDrag$system.be(dnd); + $author$project$DnDList$Movement$HorizontalOnDrag$itemStyles, + A2($elm$core$List$member, index, affected) ? $author$project$DnDList$Movement$HorizontalOnDrag$affectedStyles : _List_Nil)); + var _v0 = $author$project$DnDList$Movement$HorizontalOnDrag$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$HorizontalOnDrag$system.cU, index, itemId)), + A2($author$project$DnDList$Movement$HorizontalOnDrag$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])) : A2( $elm$html$Html$div, - _Utils_ap(attrs, $author$project$Config$Movement$HorizontalOnDrag$placeholderStyles), + _Utils_ap(attrs, $author$project$DnDList$Movement$HorizontalOnDrag$placeholderStyles), _List_Nil); } else { return A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$HorizontalOnDrag$system.cT, index, itemId)), + A2($author$project$DnDList$Movement$HorizontalOnDrag$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])); } }); -var $author$project$Config$Movement$HorizontalOnDrag$view = function (model) { +var $author$project$DnDList$Movement$HorizontalOnDrag$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$Movement$HorizontalOnDrag$ClearAffected) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$Movement$HorizontalOnDrag$ClearAffected) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$Movement$HorizontalOnDrag$containerStyles, + $author$project$DnDList$Movement$HorizontalOnDrag$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$HorizontalOnDrag$itemView, model.aa, model.I), - model.au)), - A2($author$project$Config$Movement$HorizontalOnDrag$ghostView, model.aa, model.au) + A2($author$project$DnDList$Movement$HorizontalOnDrag$itemView, model.Z, model.I), + model.av)), + A2($author$project$DnDList$Movement$HorizontalOnDrag$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$Movement$HorizontalOnDrop$ClearAffected = {$: 1}; -var $author$project$Config$Movement$HorizontalOnDrop$containerStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrop$ClearAffected = {$: 1}; +var $author$project$DnDList$Movement$HorizontalOnDrop$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex') ]); -var $author$project$Config$Movement$HorizontalOnDrop$ghostStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrop$ghostStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d') ]); -var $author$project$Config$Movement$HorizontalOnDrop$itemStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrop$itemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa'), A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), @@ -13484,25 +14856,25 @@ var $author$project$Config$Movement$HorizontalOnDrop$itemStyles = _List_fromArra A2($elm$html$Html$Attributes$style, 'width', '50px'), A2($elm$html$Html$Attributes$style, 'height', '50px') ]); -var $author$project$Config$Movement$HorizontalOnDrop$ghostView = F2( +var $author$project$DnDList$Movement$HorizontalOnDrop$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$Movement$HorizontalOnDrop$system.be(dnd)); + $author$project$DnDList$Movement$HorizontalOnDrop$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrop$itemStyles, + $author$project$DnDList$Movement$HorizontalOnDrop$itemStyles, _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrop$ghostStyles, - $author$project$Config$Movement$HorizontalOnDrop$system.c$(dnd))), + $author$project$DnDList$Movement$HorizontalOnDrop$ghostStyles, + $author$project$DnDList$Movement$HorizontalOnDrop$system.bS(dnd))), _List_fromArray( [ $elm$html$Html$text(item) @@ -13511,36 +14883,36 @@ var $author$project$Config$Movement$HorizontalOnDrop$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$Movement$HorizontalOnDrop$affectedStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrop$affectedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#136169') ]); -var $author$project$Config$Movement$HorizontalOnDrop$overedStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrop$overedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#63bdc7') ]); -var $author$project$Config$Movement$HorizontalOnDrop$placeholderStyles = _List_fromArray( +var $author$project$DnDList$Movement$HorizontalOnDrop$placeholderStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') ]); -var $author$project$Config$Movement$HorizontalOnDrop$itemView = F4( +var $author$project$DnDList$Movement$HorizontalOnDrop$itemView = F4( function (dnd, affected, index, item) { var itemId = 'hrdrop-' + item; var attrs = A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrop$itemStyles, - A2($elm$core$List$member, index, affected) ? $author$project$Config$Movement$HorizontalOnDrop$affectedStyles : _List_Nil)); - var _v0 = $author$project$Config$Movement$HorizontalOnDrop$system.be(dnd); + $author$project$DnDList$Movement$HorizontalOnDrop$itemStyles, + A2($elm$core$List$member, index, affected) ? $author$project$DnDList$Movement$HorizontalOnDrop$affectedStyles : _List_Nil)); + var _v0 = $author$project$DnDList$Movement$HorizontalOnDrop$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; - var dropIndex = _v0.a.cV; + var dragIndex = _v0.a.c; + var dropIndex = _v0.a.h; return ((!_Utils_eq(dragIndex, index)) && (!_Utils_eq(dropIndex, index))) ? A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$HorizontalOnDrop$system.cU, index, itemId)), + A2($author$project$DnDList$Movement$HorizontalOnDrop$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) @@ -13549,57 +14921,57 @@ var $author$project$Config$Movement$HorizontalOnDrop$itemView = F4( _Utils_ap( attrs, _Utils_ap( - $author$project$Config$Movement$HorizontalOnDrop$overedStyles, - A2($author$project$Config$Movement$HorizontalOnDrop$system.cU, index, itemId))), + $author$project$DnDList$Movement$HorizontalOnDrop$overedStyles, + A2($author$project$DnDList$Movement$HorizontalOnDrop$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) ])) : A2( $elm$html$Html$div, - _Utils_ap(attrs, $author$project$Config$Movement$HorizontalOnDrop$placeholderStyles), + _Utils_ap(attrs, $author$project$DnDList$Movement$HorizontalOnDrop$placeholderStyles), _List_Nil)); } else { return A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$HorizontalOnDrop$system.cT, index, itemId)), + A2($author$project$DnDList$Movement$HorizontalOnDrop$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])); } }); -var $author$project$Config$Movement$HorizontalOnDrop$view = function (model) { +var $author$project$DnDList$Movement$HorizontalOnDrop$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$Movement$HorizontalOnDrop$ClearAffected) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$Movement$HorizontalOnDrop$ClearAffected) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$Movement$HorizontalOnDrop$containerStyles, + $author$project$DnDList$Movement$HorizontalOnDrop$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$HorizontalOnDrop$itemView, model.aa, model.I), - model.au)), - A2($author$project$Config$Movement$HorizontalOnDrop$ghostView, model.aa, model.au) + A2($author$project$DnDList$Movement$HorizontalOnDrop$itemView, model.Z, model.I), + model.av)), + A2($author$project$DnDList$Movement$HorizontalOnDrop$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$Movement$VerticalOnDrag$ClearAffected = {$: 1}; -var $author$project$Config$Movement$VerticalOnDrag$containerStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrag$ClearAffected = {$: 1}; +var $author$project$DnDList$Movement$VerticalOnDrag$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column') ]); -var $author$project$Config$Movement$VerticalOnDrag$ghostStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrag$ghostStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa') ]); -var $author$project$Config$Movement$VerticalOnDrag$itemStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrag$itemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d'), A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), @@ -13613,25 +14985,25 @@ var $author$project$Config$Movement$VerticalOnDrag$itemStyles = _List_fromArray( A2($elm$html$Html$Attributes$style, 'width', '50px'), A2($elm$html$Html$Attributes$style, 'height', '50px') ]); -var $author$project$Config$Movement$VerticalOnDrag$ghostView = F2( +var $author$project$DnDList$Movement$VerticalOnDrag$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$Movement$VerticalOnDrag$system.be(dnd)); + $author$project$DnDList$Movement$VerticalOnDrag$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$Movement$VerticalOnDrag$itemStyles, + $author$project$DnDList$Movement$VerticalOnDrag$itemStyles, _Utils_ap( - $author$project$Config$Movement$VerticalOnDrag$ghostStyles, - $author$project$Config$Movement$VerticalOnDrag$system.c$(dnd))), + $author$project$DnDList$Movement$VerticalOnDrag$ghostStyles, + $author$project$DnDList$Movement$VerticalOnDrag$system.bS(dnd))), _List_fromArray( [ $elm$html$Html$text(item) @@ -13640,80 +15012,80 @@ var $author$project$Config$Movement$VerticalOnDrag$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$Movement$VerticalOnDrag$affectedStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrag$affectedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#691361') ]); -var $author$project$Config$Movement$VerticalOnDrag$placeholderStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrag$placeholderStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') ]); -var $author$project$Config$Movement$VerticalOnDrag$itemView = F4( +var $author$project$DnDList$Movement$VerticalOnDrag$itemView = F4( function (dnd, affected, index, item) { var itemId = 'vrdrag-' + item; var attrs = A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$Movement$VerticalOnDrag$itemStyles, - A2($elm$core$List$member, index, affected) ? $author$project$Config$Movement$VerticalOnDrag$affectedStyles : _List_Nil)); - var _v0 = $author$project$Config$Movement$VerticalOnDrag$system.be(dnd); + $author$project$DnDList$Movement$VerticalOnDrag$itemStyles, + A2($elm$core$List$member, index, affected) ? $author$project$DnDList$Movement$VerticalOnDrag$affectedStyles : _List_Nil)); + var _v0 = $author$project$DnDList$Movement$VerticalOnDrag$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$VerticalOnDrag$system.cU, index, itemId)), + A2($author$project$DnDList$Movement$VerticalOnDrag$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])) : A2( $elm$html$Html$div, - _Utils_ap(attrs, $author$project$Config$Movement$VerticalOnDrag$placeholderStyles), + _Utils_ap(attrs, $author$project$DnDList$Movement$VerticalOnDrag$placeholderStyles), _List_Nil); } else { return A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$VerticalOnDrag$system.cT, index, itemId)), + A2($author$project$DnDList$Movement$VerticalOnDrag$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])); } }); -var $author$project$Config$Movement$VerticalOnDrag$view = function (model) { +var $author$project$DnDList$Movement$VerticalOnDrag$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$Movement$VerticalOnDrag$ClearAffected) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$Movement$VerticalOnDrag$ClearAffected) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$Movement$VerticalOnDrag$containerStyles, + $author$project$DnDList$Movement$VerticalOnDrag$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$VerticalOnDrag$itemView, model.aa, model.I), - model.au)), - A2($author$project$Config$Movement$VerticalOnDrag$ghostView, model.aa, model.au) + A2($author$project$DnDList$Movement$VerticalOnDrag$itemView, model.Z, model.I), + model.av)), + A2($author$project$DnDList$Movement$VerticalOnDrag$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$Movement$VerticalOnDrop$ClearAffected = {$: 1}; -var $author$project$Config$Movement$VerticalOnDrop$containerStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$ClearAffected = {$: 1}; +var $author$project$DnDList$Movement$VerticalOnDrop$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column') ]); -var $author$project$Config$Movement$VerticalOnDrop$ghostStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$ghostStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#aa1e9d') ]); -var $author$project$Config$Movement$VerticalOnDrop$itemStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$itemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#1e9daa'), A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), @@ -13727,25 +15099,25 @@ var $author$project$Config$Movement$VerticalOnDrop$itemStyles = _List_fromArray( A2($elm$html$Html$Attributes$style, 'width', '50px'), A2($elm$html$Html$Attributes$style, 'height', '50px') ]); -var $author$project$Config$Movement$VerticalOnDrop$ghostView = F2( +var $author$project$DnDList$Movement$VerticalOnDrop$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$Movement$VerticalOnDrop$system.be(dnd)); + $author$project$DnDList$Movement$VerticalOnDrop$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$Movement$VerticalOnDrop$itemStyles, + $author$project$DnDList$Movement$VerticalOnDrop$itemStyles, _Utils_ap( - $author$project$Config$Movement$VerticalOnDrop$ghostStyles, - $author$project$Config$Movement$VerticalOnDrop$system.c$(dnd))), + $author$project$DnDList$Movement$VerticalOnDrop$ghostStyles, + $author$project$DnDList$Movement$VerticalOnDrop$system.bS(dnd))), _List_fromArray( [ $elm$html$Html$text(item) @@ -13754,36 +15126,36 @@ var $author$project$Config$Movement$VerticalOnDrop$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$Movement$VerticalOnDrop$affectedStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$affectedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#136169') ]); -var $author$project$Config$Movement$VerticalOnDrop$overedStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$overedStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', '#63bdc7') ]); -var $author$project$Config$Movement$VerticalOnDrop$placeholderStyles = _List_fromArray( +var $author$project$DnDList$Movement$VerticalOnDrop$placeholderStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', 'dimgray') ]); -var $author$project$Config$Movement$VerticalOnDrop$itemView = F4( +var $author$project$DnDList$Movement$VerticalOnDrop$itemView = F4( function (dnd, affected, index, item) { var itemId = 'vrdrop-' + item; var attrs = A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$Movement$VerticalOnDrop$itemStyles, - A2($elm$core$List$member, index, affected) ? $author$project$Config$Movement$VerticalOnDrop$affectedStyles : _List_Nil)); - var _v0 = $author$project$Config$Movement$VerticalOnDrop$system.be(dnd); + $author$project$DnDList$Movement$VerticalOnDrop$itemStyles, + A2($elm$core$List$member, index, affected) ? $author$project$DnDList$Movement$VerticalOnDrop$affectedStyles : _List_Nil)); + var _v0 = $author$project$DnDList$Movement$VerticalOnDrop$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; - var dropIndex = _v0.a.cV; + var dragIndex = _v0.a.c; + var dropIndex = _v0.a.h; return ((!_Utils_eq(dragIndex, index)) && (!_Utils_eq(dropIndex, index))) ? A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$VerticalOnDrop$system.cU, index, itemId)), + A2($author$project$DnDList$Movement$VerticalOnDrop$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) @@ -13792,87 +15164,87 @@ var $author$project$Config$Movement$VerticalOnDrop$itemView = F4( _Utils_ap( attrs, _Utils_ap( - $author$project$Config$Movement$VerticalOnDrop$overedStyles, - A2($author$project$Config$Movement$VerticalOnDrop$system.cU, index, itemId))), + $author$project$DnDList$Movement$VerticalOnDrop$overedStyles, + A2($author$project$DnDList$Movement$VerticalOnDrop$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) ])) : A2( $elm$html$Html$div, - _Utils_ap(attrs, $author$project$Config$Movement$VerticalOnDrop$placeholderStyles), + _Utils_ap(attrs, $author$project$DnDList$Movement$VerticalOnDrop$placeholderStyles), _List_Nil)); } else { return A2( $elm$html$Html$div, _Utils_ap( attrs, - A2($author$project$Config$Movement$VerticalOnDrop$system.cT, index, itemId)), + A2($author$project$DnDList$Movement$VerticalOnDrop$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) ])); } }); -var $author$project$Config$Movement$VerticalOnDrop$view = function (model) { +var $author$project$DnDList$Movement$VerticalOnDrop$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$Movement$VerticalOnDrop$ClearAffected) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$Movement$VerticalOnDrop$ClearAffected) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$Movement$VerticalOnDrop$containerStyles, + $author$project$DnDList$Movement$VerticalOnDrop$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$VerticalOnDrop$itemView, model.aa, model.I), - model.au)), - A2($author$project$Config$Movement$VerticalOnDrop$ghostView, model.aa, model.au) + A2($author$project$DnDList$Movement$VerticalOnDrop$itemView, model.Z, model.I), + model.av)), + A2($author$project$DnDList$Movement$VerticalOnDrop$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$Movement$Root$demoView = function (example) { +var $author$project$DnDList$Movement$Parent$demoView = function (example) { switch (example.$) { case 0: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$Movement$Root$FreeOnDragMsg, - $author$project$Config$Movement$FreeOnDrag$view(mo)); + $author$project$DnDList$Movement$Parent$FreeOnDragMsg, + $author$project$DnDList$Movement$FreeOnDrag$view(mo)); case 1: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$Movement$Root$FreeOnDropMsg, - $author$project$Config$Movement$FreeOnDrop$view(mo)); + $author$project$DnDList$Movement$Parent$FreeOnDropMsg, + $author$project$DnDList$Movement$FreeOnDrop$view(mo)); case 2: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$Movement$Root$HorizontalOnDragMsg, - $author$project$Config$Movement$HorizontalOnDrag$view(mo)); + $author$project$DnDList$Movement$Parent$HorizontalOnDragMsg, + $author$project$DnDList$Movement$HorizontalOnDrag$view(mo)); case 3: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$Movement$Root$HorizontalOnDropMsg, - $author$project$Config$Movement$HorizontalOnDrop$view(mo)); + $author$project$DnDList$Movement$Parent$HorizontalOnDropMsg, + $author$project$DnDList$Movement$HorizontalOnDrop$view(mo)); case 4: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$Movement$Root$VerticalOnDragMsg, - $author$project$Config$Movement$VerticalOnDrag$view(mo)); + $author$project$DnDList$Movement$Parent$VerticalOnDragMsg, + $author$project$DnDList$Movement$VerticalOnDrag$view(mo)); default: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$Movement$Root$VerticalOnDropMsg, - $author$project$Config$Movement$VerticalOnDrop$view(mo)); + $author$project$DnDList$Movement$Parent$VerticalOnDropMsg, + $author$project$DnDList$Movement$VerticalOnDrop$view(mo)); } }; -var $author$project$Config$Movement$Root$info = function (example) { +var $author$project$DnDList$Movement$Parent$info = function (example) { switch (example.$) { case 0: return 'Free on drag'; @@ -13888,13 +15260,7 @@ var $author$project$Config$Movement$Root$info = function (example) { return 'Vertical on drop'; } }; -var $elm$html$Html$Events$onClick = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'click', - $elm$json$Json$Decode$succeed(msg)); -}; -var $author$project$Config$Movement$Root$demoWrapperView = F4( +var $author$project$DnDList$Movement$Parent$demoWrapperView = F4( function (offset, currentId, id, example) { var globalId = offset + id; return A2( @@ -13907,7 +15273,7 @@ var $author$project$Config$Movement$Root$demoWrapperView = F4( ]), _List_fromArray( [ - $author$project$Config$Movement$Root$demoView(example), + $author$project$DnDList$Movement$Parent$demoView(example), A2( $elm$html$Html$div, _List_fromArray( @@ -13921,16 +15287,16 @@ var $author$project$Config$Movement$Root$demoWrapperView = F4( _Utils_eq(globalId, currentId)) ])), $elm$html$Html$Events$onClick( - $author$project$Config$Movement$Root$LinkClicked(globalId)) + $author$project$DnDList$Movement$Parent$LinkClicked(globalId)) ]), _List_fromArray( [ $elm$html$Html$text( - $author$project$Config$Movement$Root$info(example)) + $author$project$DnDList$Movement$Parent$info(example)) ])) ])); }); -var $author$project$Config$Movement$Root$view = function (model) { +var $author$project$DnDList$Movement$Parent$view = function (model) { return A2( $elm$html$Html$div, _List_Nil, @@ -13947,18 +15313,18 @@ var $author$project$Config$Movement$Root$view = function (model) { ]), A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$Root$demoWrapperView, 0, model.at), - A2($elm$core$List$take, 2, model.Q))), + A2($author$project$DnDList$Movement$Parent$demoWrapperView, 0, model.a7), + A2($elm$core$List$take, 2, model.at))), A2( $elm$html$Html$section, _List_Nil, A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$Root$demoWrapperView, 2, model.at), + A2($author$project$DnDList$Movement$Parent$demoWrapperView, 2, model.a7), A2( $elm$core$List$take, 2, - A2($elm$core$List$drop, 2, model.Q)))), + A2($elm$core$List$drop, 2, model.at)))), A2( $elm$html$Html$section, _List_fromArray( @@ -13968,25 +15334,25 @@ var $author$project$Config$Movement$Root$view = function (model) { ]), A2( $elm$core$List$indexedMap, - A2($author$project$Config$Movement$Root$demoWrapperView, 4, model.at), + A2($author$project$DnDList$Movement$Parent$demoWrapperView, 4, model.a7), A2( $elm$core$List$take, 2, - A2($elm$core$List$drop, 4, model.Q)))) + A2($elm$core$List$drop, 4, model.at)))) ])); }; -var $author$project$Config$OperationsOnDrag$Root$LinkClicked = function (a) { +var $author$project$DnDList$OperationsOnDrag$Parent$LinkClicked = function (a) { return {$: 0, a: a}; }; -var $author$project$Config$OperationsOnDrag$InsertAfter$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrag$InsertAfter$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrag$InsertAfter$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrag$InsertAfter$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrag$InsertAfter$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14000,23 +15366,23 @@ var $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles = function (c A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrag$InsertAfter$ghostView = F2( +var $author$project$DnDList$OperationsOnDrag$InsertAfter$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrag$InsertAfter$system.be(dnd)); + $author$project$DnDList$OperationsOnDrag$InsertAfter$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles($author$project$Config$OperationsOnDrag$InsertAfter$dragColor), - $author$project$Config$OperationsOnDrag$InsertAfter$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrag$InsertAfter$itemStyles($author$project$DnDList$OperationsOnDrag$InsertAfter$dragColor), + $author$project$DnDList$OperationsOnDrag$InsertAfter$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14025,23 +15391,23 @@ var $author$project$Config$OperationsOnDrag$InsertAfter$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrag$InsertAfter$itemView = F3( +var $author$project$DnDList$OperationsOnDrag$InsertAfter$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var itemId = 'insertafter-' + value; - var _v1 = $author$project$Config$OperationsOnDrag$InsertAfter$system.be(dnd); + var _v1 = $author$project$DnDList$OperationsOnDrag$InsertAfter$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$InsertAfter$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$InsertAfter$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$InsertAfter$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14051,8 +15417,8 @@ var $author$project$Config$OperationsOnDrag$InsertAfter$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles($author$project$Config$OperationsOnDrag$InsertAfter$dropColor), - A2($author$project$Config$OperationsOnDrag$InsertAfter$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$InsertAfter$itemStyles($author$project$DnDList$OperationsOnDrag$InsertAfter$dropColor), + A2($author$project$DnDList$OperationsOnDrag$InsertAfter$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14061,7 +15427,7 @@ var $author$project$Config$OperationsOnDrag$InsertAfter$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles($author$project$Config$OperationsOnDrag$InsertAfter$dropColor)), + $author$project$DnDList$OperationsOnDrag$InsertAfter$itemStyles($author$project$DnDList$OperationsOnDrag$InsertAfter$dropColor)), _List_Nil)); } else { return A2( @@ -14070,42 +15436,42 @@ var $author$project$Config$OperationsOnDrag$InsertAfter$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertAfter$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$InsertAfter$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrag$InsertAfter$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$InsertAfter$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrag$InsertAfter$view = function (model) { +var $author$project$DnDList$OperationsOnDrag$InsertAfter$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrag$InsertAfter$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrag$InsertAfter$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrag$InsertAfter$containerStyles, + $author$project$DnDList$OperationsOnDrag$InsertAfter$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrag$InsertAfter$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrag$InsertAfter$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrag$InsertAfter$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrag$InsertAfter$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrag$InsertBefore$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrag$InsertBefore$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrag$InsertBefore$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrag$InsertBefore$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrag$InsertBefore$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14119,23 +15485,23 @@ var $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles = function ( A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrag$InsertBefore$ghostView = F2( +var $author$project$DnDList$OperationsOnDrag$InsertBefore$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrag$InsertBefore$system.be(dnd)); + $author$project$DnDList$OperationsOnDrag$InsertBefore$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles($author$project$Config$OperationsOnDrag$InsertBefore$dragColor), - $author$project$Config$OperationsOnDrag$InsertBefore$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrag$InsertBefore$itemStyles($author$project$DnDList$OperationsOnDrag$InsertBefore$dragColor), + $author$project$DnDList$OperationsOnDrag$InsertBefore$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14144,23 +15510,23 @@ var $author$project$Config$OperationsOnDrag$InsertBefore$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrag$InsertBefore$itemView = F3( +var $author$project$DnDList$OperationsOnDrag$InsertBefore$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var itemId = 'insertbefore-' + value; - var _v1 = $author$project$Config$OperationsOnDrag$InsertBefore$system.be(dnd); + var _v1 = $author$project$DnDList$OperationsOnDrag$InsertBefore$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$InsertBefore$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$InsertBefore$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$InsertBefore$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14170,8 +15536,8 @@ var $author$project$Config$OperationsOnDrag$InsertBefore$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles($author$project$Config$OperationsOnDrag$InsertBefore$dropColor), - A2($author$project$Config$OperationsOnDrag$InsertBefore$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$InsertBefore$itemStyles($author$project$DnDList$OperationsOnDrag$InsertBefore$dropColor), + A2($author$project$DnDList$OperationsOnDrag$InsertBefore$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14180,7 +15546,7 @@ var $author$project$Config$OperationsOnDrag$InsertBefore$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles($author$project$Config$OperationsOnDrag$InsertBefore$dropColor)), + $author$project$DnDList$OperationsOnDrag$InsertBefore$itemStyles($author$project$DnDList$OperationsOnDrag$InsertBefore$dropColor)), _List_Nil)); } else { return A2( @@ -14189,42 +15555,42 @@ var $author$project$Config$OperationsOnDrag$InsertBefore$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$InsertBefore$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$InsertBefore$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrag$InsertBefore$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$InsertBefore$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrag$InsertBefore$view = function (model) { +var $author$project$DnDList$OperationsOnDrag$InsertBefore$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrag$InsertBefore$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrag$InsertBefore$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrag$InsertBefore$containerStyles, + $author$project$DnDList$OperationsOnDrag$InsertBefore$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrag$InsertBefore$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrag$InsertBefore$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrag$InsertBefore$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrag$InsertBefore$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrag$Rotate$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrag$Rotate$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrag$Rotate$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrag$Rotate$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrag$Rotate$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrag$Rotate$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14238,23 +15604,23 @@ var $author$project$Config$OperationsOnDrag$Rotate$itemStyles = function (color) A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrag$Rotate$ghostView = F2( +var $author$project$DnDList$OperationsOnDrag$Rotate$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrag$Rotate$system.be(dnd)); + $author$project$DnDList$OperationsOnDrag$Rotate$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrag$Rotate$itemStyles($author$project$Config$OperationsOnDrag$Rotate$dragColor), - $author$project$Config$OperationsOnDrag$Rotate$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrag$Rotate$itemStyles($author$project$DnDList$OperationsOnDrag$Rotate$dragColor), + $author$project$DnDList$OperationsOnDrag$Rotate$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14263,23 +15629,23 @@ var $author$project$Config$OperationsOnDrag$Rotate$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrag$Rotate$itemView = F3( +var $author$project$DnDList$OperationsOnDrag$Rotate$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var itemId = 'rotateout-' + value; - var _v1 = $author$project$Config$OperationsOnDrag$Rotate$system.be(dnd); + var _v1 = $author$project$DnDList$OperationsOnDrag$Rotate$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Rotate$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$Rotate$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Rotate$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$Rotate$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14288,7 +15654,7 @@ var $author$project$Config$OperationsOnDrag$Rotate$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrag$Rotate$itemStyles($author$project$Config$OperationsOnDrag$Rotate$dropColor)), + $author$project$DnDList$OperationsOnDrag$Rotate$itemStyles($author$project$DnDList$OperationsOnDrag$Rotate$dropColor)), _List_Nil); } else { return A2( @@ -14297,42 +15663,42 @@ var $author$project$Config$OperationsOnDrag$Rotate$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Rotate$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$Rotate$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Rotate$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$Rotate$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrag$Rotate$view = function (model) { +var $author$project$DnDList$OperationsOnDrag$Rotate$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrag$Rotate$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrag$Rotate$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrag$Rotate$containerStyles, + $author$project$DnDList$OperationsOnDrag$Rotate$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrag$Rotate$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrag$Rotate$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrag$Rotate$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrag$Rotate$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrag$Swap$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrag$Swap$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrag$Swap$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrag$Swap$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrag$Swap$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrag$Swap$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14346,23 +15712,23 @@ var $author$project$Config$OperationsOnDrag$Swap$itemStyles = function (color) { A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrag$Swap$ghostView = F2( +var $author$project$DnDList$OperationsOnDrag$Swap$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrag$Swap$system.be(dnd)); + $author$project$DnDList$OperationsOnDrag$Swap$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrag$Swap$itemStyles($author$project$Config$OperationsOnDrag$Swap$dragColor), - $author$project$Config$OperationsOnDrag$Swap$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrag$Swap$itemStyles($author$project$DnDList$OperationsOnDrag$Swap$dragColor), + $author$project$DnDList$OperationsOnDrag$Swap$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14371,23 +15737,23 @@ var $author$project$Config$OperationsOnDrag$Swap$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrag$Swap$itemView = F3( +var $author$project$DnDList$OperationsOnDrag$Swap$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var itemId = 'swap-' + value; - var _v1 = $author$project$Config$OperationsOnDrag$Swap$system.be(dnd); + var _v1 = $author$project$DnDList$OperationsOnDrag$Swap$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Swap$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$Swap$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Swap$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$Swap$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14396,7 +15762,7 @@ var $author$project$Config$OperationsOnDrag$Swap$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrag$Swap$itemStyles($author$project$Config$OperationsOnDrag$Swap$dropColor)), + $author$project$DnDList$OperationsOnDrag$Swap$itemStyles($author$project$DnDList$OperationsOnDrag$Swap$dropColor)), _List_Nil); } else { return A2( @@ -14405,42 +15771,42 @@ var $author$project$Config$OperationsOnDrag$Swap$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Swap$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$Swap$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Swap$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$Swap$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrag$Swap$view = function (model) { +var $author$project$DnDList$OperationsOnDrag$Swap$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrag$Swap$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrag$Swap$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrag$Swap$containerStyles, + $author$project$DnDList$OperationsOnDrag$Swap$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrag$Swap$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrag$Swap$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrag$Swap$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrag$Swap$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrag$Unaltered$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrag$Unaltered$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrag$Unaltered$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrag$Unaltered$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrag$Unaltered$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrag$Unaltered$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14454,23 +15820,23 @@ var $author$project$Config$OperationsOnDrag$Unaltered$itemStyles = function (col A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrag$Unaltered$ghostView = F2( +var $author$project$DnDList$OperationsOnDrag$Unaltered$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrag$Unaltered$system.be(dnd)); + $author$project$DnDList$OperationsOnDrag$Unaltered$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrag$Unaltered$itemStyles($author$project$Config$OperationsOnDrag$Unaltered$dragColor), - $author$project$Config$OperationsOnDrag$Unaltered$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrag$Unaltered$itemStyles($author$project$DnDList$OperationsOnDrag$Unaltered$dragColor), + $author$project$DnDList$OperationsOnDrag$Unaltered$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14479,23 +15845,23 @@ var $author$project$Config$OperationsOnDrag$Unaltered$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrag$Unaltered$itemView = F3( +var $author$project$DnDList$OperationsOnDrag$Unaltered$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var itemId = 'unaltered-' + value; - var _v1 = $author$project$Config$OperationsOnDrag$Unaltered$system.be(dnd); + var _v1 = $author$project$DnDList$OperationsOnDrag$Unaltered$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Unaltered$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$Unaltered$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Unaltered$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$Unaltered$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14505,8 +15871,8 @@ var $author$project$Config$OperationsOnDrag$Unaltered$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Unaltered$itemStyles($author$project$Config$OperationsOnDrag$Unaltered$dropColor), - A2($author$project$Config$OperationsOnDrag$Unaltered$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Unaltered$itemStyles($author$project$DnDList$OperationsOnDrag$Unaltered$dropColor), + A2($author$project$DnDList$OperationsOnDrag$Unaltered$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14515,7 +15881,7 @@ var $author$project$Config$OperationsOnDrag$Unaltered$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrag$Unaltered$itemStyles($author$project$Config$OperationsOnDrag$Unaltered$dropColor)), + $author$project$DnDList$OperationsOnDrag$Unaltered$itemStyles($author$project$DnDList$OperationsOnDrag$Unaltered$dropColor)), _List_Nil)); } else { return A2( @@ -14524,68 +15890,68 @@ var $author$project$Config$OperationsOnDrag$Unaltered$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrag$Unaltered$itemStyles(color), - A2($author$project$Config$OperationsOnDrag$Unaltered$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrag$Unaltered$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrag$Unaltered$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrag$Unaltered$view = function (model) { +var $author$project$DnDList$OperationsOnDrag$Unaltered$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrag$Unaltered$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrag$Unaltered$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrag$Unaltered$containerStyles, + $author$project$DnDList$OperationsOnDrag$Unaltered$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrag$Unaltered$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrag$Unaltered$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrag$Unaltered$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrag$Unaltered$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrag$Root$demoView = function (example) { +var $author$project$DnDList$OperationsOnDrag$Parent$demoView = function (example) { switch (example.$) { case 0: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$OperationsOnDrag$Root$InsertAfterMsg, - $author$project$Config$OperationsOnDrag$InsertAfter$view(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$InsertAfterMsg, + $author$project$DnDList$OperationsOnDrag$InsertAfter$view(mo)); case 1: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$OperationsOnDrag$Root$InsertBeforeMsg, - $author$project$Config$OperationsOnDrag$InsertBefore$view(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$InsertBeforeMsg, + $author$project$DnDList$OperationsOnDrag$InsertBefore$view(mo)); case 2: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$OperationsOnDrag$Root$RotateMsg, - $author$project$Config$OperationsOnDrag$Rotate$view(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$RotateMsg, + $author$project$DnDList$OperationsOnDrag$Rotate$view(mo)); case 3: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$OperationsOnDrag$Root$SwapMsg, - $author$project$Config$OperationsOnDrag$Swap$view(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$SwapMsg, + $author$project$DnDList$OperationsOnDrag$Swap$view(mo)); default: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$Config$OperationsOnDrag$Root$UnalteredMsg, - $author$project$Config$OperationsOnDrag$Unaltered$view(mo)); + $author$project$DnDList$OperationsOnDrag$Parent$UnalteredMsg, + $author$project$DnDList$OperationsOnDrag$Unaltered$view(mo)); } }; -var $author$project$Config$OperationsOnDrag$Root$info = function (example) { +var $author$project$DnDList$OperationsOnDrag$Parent$info = function (example) { switch (example.$) { case 0: return 'Insert after'; @@ -14599,7 +15965,7 @@ var $author$project$Config$OperationsOnDrag$Root$info = function (example) { return 'Unaltered'; } }; -var $author$project$Config$OperationsOnDrag$Root$demoWrapperView = F3( +var $author$project$DnDList$OperationsOnDrag$Parent$demoWrapperView = F3( function (currentId, id, example) { return A2( $elm$html$Html$div, @@ -14612,7 +15978,7 @@ var $author$project$Config$OperationsOnDrag$Root$demoWrapperView = F3( ]), _List_fromArray( [ - $author$project$Config$OperationsOnDrag$Root$demoView(example), + $author$project$DnDList$OperationsOnDrag$Parent$demoView(example), A2( $elm$html$Html$div, _List_fromArray( @@ -14626,36 +15992,274 @@ var $author$project$Config$OperationsOnDrag$Root$demoWrapperView = F3( _Utils_eq(id, currentId)) ])), $elm$html$Html$Events$onClick( - $author$project$Config$OperationsOnDrag$Root$LinkClicked(id)) + $author$project$DnDList$OperationsOnDrag$Parent$LinkClicked(id)) ]), _List_fromArray( [ $elm$html$Html$text( - $author$project$Config$OperationsOnDrag$Root$info(example)) + $author$project$DnDList$OperationsOnDrag$Parent$info(example)) ])) ])); }); -var $author$project$Config$OperationsOnDrag$Root$view = function (model) { +var $author$project$DnDList$OperationsOnDrag$Parent$view = function (model) { + return A2( + $elm$html$Html$section, + _List_Nil, + A2( + $elm$core$List$indexedMap, + $author$project$DnDList$OperationsOnDrag$Parent$demoWrapperView(model.a7), + model.at)); +}; +var $author$project$DnDList$OperationsOnDrop$Parent$LinkClicked = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$containerStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), + A2($elm$html$Html$Attributes$style, 'align-items', 'center'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center') + ]); +var $author$project$DnDList$OperationsOnDrop$InsertAfter$itemStyles = function (color) { + return _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', color), + A2($elm$html$Html$Attributes$style, 'color', 'white'), + A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'align-items', 'center'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'margin', '0 1.5em 1.5em 0'), + A2($elm$html$Html$Attributes$style, 'width', '50px'), + A2($elm$html$Html$Attributes$style, 'height', '50px') + ]); +}; +var $author$project$DnDList$OperationsOnDrop$InsertAfter$ghostView = F2( + function (dnd, items) { + var maybeDragItem = A2( + $elm$core$Maybe$andThen, + function (_v1) { + var dragIndex = _v1.c; + return $elm$core$List$head( + A2($elm$core$List$drop, dragIndex, items)); + }, + $author$project$DnDList$OperationsOnDrop$InsertAfter$system.bX(dnd)); + if (!maybeDragItem.$) { + var value = maybeDragItem.a.aC; + return A2( + $elm$html$Html$div, + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertAfter$itemStyles($author$project$DnDList$OperationsOnDrop$InsertAfter$dragColor), + $author$project$DnDList$OperationsOnDrop$InsertAfter$system.bS(dnd)), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])); + } else { + return $elm$html$Html$text(''); + } + }); +var $author$project$DnDList$OperationsOnDrop$InsertAfter$itemView = F3( + function (dnd, index, _v0) { + var value = _v0.aC; + var color = _v0.a_; + var itemId = 'insertafter-' + value; + var _v1 = $author$project$DnDList$OperationsOnDrop$InsertAfter$system.bX(dnd); + if (!_v1.$) { + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; + return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertAfter$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$InsertAfter$system.bM, index, itemId))), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])) : (((!_Utils_eq(index, dragIndex)) && _Utils_eq(index, dropIndex)) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertAfter$itemStyles($author$project$DnDList$OperationsOnDrop$InsertAfter$dropColor), + A2($author$project$DnDList$OperationsOnDrop$InsertAfter$system.bM, index, itemId))), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])) : A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDList$OperationsOnDrop$InsertAfter$itemStyles($author$project$DnDList$OperationsOnDrop$InsertAfter$dropColor)), + _List_Nil)); + } else { + return A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertAfter$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$InsertAfter$system.bL, index, itemId))), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])); + } + }); +var $author$project$DnDList$OperationsOnDrop$InsertAfter$view = function (model) { + return A2( + $elm$html$Html$section, + _List_fromArray( + [ + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrop$InsertAfter$ResetColors) + ]), + _List_fromArray( + [ + A2( + $elm$html$Html$div, + $author$project$DnDList$OperationsOnDrop$InsertAfter$containerStyles, + A2( + $elm$core$List$indexedMap, + $author$project$DnDList$OperationsOnDrop$InsertAfter$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrop$InsertAfter$ghostView, model.Z, model.av) + ])); +}; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$containerStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), + A2($elm$html$Html$Attributes$style, 'align-items', 'center'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center') + ]); +var $author$project$DnDList$OperationsOnDrop$InsertBefore$itemStyles = function (color) { + return _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'background-color', color), + A2($elm$html$Html$Attributes$style, 'color', 'white'), + A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'align-items', 'center'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'margin', '0 1.5em 1.5em 0'), + A2($elm$html$Html$Attributes$style, 'width', '50px'), + A2($elm$html$Html$Attributes$style, 'height', '50px') + ]); +}; +var $author$project$DnDList$OperationsOnDrop$InsertBefore$ghostView = F2( + function (dnd, items) { + var maybeDragItem = A2( + $elm$core$Maybe$andThen, + function (_v1) { + var dragIndex = _v1.c; + return $elm$core$List$head( + A2($elm$core$List$drop, dragIndex, items)); + }, + $author$project$DnDList$OperationsOnDrop$InsertBefore$system.bX(dnd)); + if (!maybeDragItem.$) { + var value = maybeDragItem.a.aC; + return A2( + $elm$html$Html$div, + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertBefore$itemStyles($author$project$DnDList$OperationsOnDrop$InsertBefore$dragColor), + $author$project$DnDList$OperationsOnDrop$InsertBefore$system.bS(dnd)), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])); + } else { + return $elm$html$Html$text(''); + } + }); +var $author$project$DnDList$OperationsOnDrop$InsertBefore$itemView = F3( + function (dnd, index, _v0) { + var value = _v0.aC; + var color = _v0.a_; + var itemId = 'insertbefore-' + value; + var _v1 = $author$project$DnDList$OperationsOnDrop$InsertBefore$system.bX(dnd); + if (!_v1.$) { + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; + return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertBefore$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$InsertBefore$system.bM, index, itemId))), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])) : (((!_Utils_eq(index, dragIndex)) && _Utils_eq(index, dropIndex)) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertBefore$itemStyles($author$project$DnDList$OperationsOnDrop$InsertBefore$dropColor), + A2($author$project$DnDList$OperationsOnDrop$InsertBefore$system.bM, index, itemId))), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])) : A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDList$OperationsOnDrop$InsertBefore$itemStyles($author$project$DnDList$OperationsOnDrop$InsertBefore$dropColor)), + _List_Nil)); + } else { + return A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDList$OperationsOnDrop$InsertBefore$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$InsertBefore$system.bL, index, itemId))), + _List_fromArray( + [ + $elm$html$Html$text(value) + ])); + } + }); +var $author$project$DnDList$OperationsOnDrop$InsertBefore$view = function (model) { return A2( $elm$html$Html$section, - _List_Nil, - A2( - $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrag$Root$demoWrapperView(model.at), - model.Q)); -}; -var $author$project$Config$OperationsOnDrop$Root$LinkClicked = function (a) { - return {$: 0, a: a}; + _List_fromArray( + [ + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrop$InsertBefore$ResetColors) + ]), + _List_fromArray( + [ + A2( + $elm$html$Html$div, + $author$project$DnDList$OperationsOnDrop$InsertBefore$containerStyles, + A2( + $elm$core$List$indexedMap, + $author$project$DnDList$OperationsOnDrop$InsertBefore$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrop$InsertBefore$ghostView, model.Z, model.av) + ])); }; -var $author$project$Config$OperationsOnDrop$InsertAfter$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrop$InsertAfter$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrop$Rotate$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrop$Rotate$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrop$Rotate$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14669,23 +16273,23 @@ var $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles = function (c A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrop$InsertAfter$ghostView = F2( +var $author$project$DnDList$OperationsOnDrop$Rotate$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrop$InsertAfter$system.be(dnd)); + $author$project$DnDList$OperationsOnDrop$Rotate$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles($author$project$Config$OperationsOnDrop$InsertAfter$dragColor), - $author$project$Config$OperationsOnDrop$InsertAfter$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrop$Rotate$itemStyles($author$project$DnDList$OperationsOnDrop$Rotate$dragColor), + $author$project$DnDList$OperationsOnDrop$Rotate$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14694,23 +16298,23 @@ var $author$project$Config$OperationsOnDrop$InsertAfter$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrop$InsertAfter$itemView = F3( +var $author$project$DnDList$OperationsOnDrop$Rotate$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; - var itemId = 'insertafter-' + value; - var _v1 = $author$project$Config$OperationsOnDrop$InsertAfter$system.be(dnd); + var value = _v0.aC; + var color = _v0.a_; + var itemId = 'rotateout-' + value; + var _v1 = $author$project$DnDList$OperationsOnDrop$Rotate$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$InsertAfter$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Rotate$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$Rotate$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14720,8 +16324,8 @@ var $author$project$Config$OperationsOnDrop$InsertAfter$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles($author$project$Config$OperationsOnDrop$InsertAfter$dropColor), - A2($author$project$Config$OperationsOnDrop$InsertAfter$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Rotate$itemStyles($author$project$DnDList$OperationsOnDrop$Rotate$dropColor), + A2($author$project$DnDList$OperationsOnDrop$Rotate$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14730,7 +16334,7 @@ var $author$project$Config$OperationsOnDrop$InsertAfter$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles($author$project$Config$OperationsOnDrop$InsertAfter$dropColor)), + $author$project$DnDList$OperationsOnDrop$Rotate$itemStyles($author$project$DnDList$OperationsOnDrop$Rotate$dropColor)), _List_Nil)); } else { return A2( @@ -14739,42 +16343,42 @@ var $author$project$Config$OperationsOnDrop$InsertAfter$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertAfter$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$InsertAfter$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Rotate$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$Rotate$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrop$InsertAfter$view = function (model) { +var $author$project$DnDList$OperationsOnDrop$Rotate$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrop$InsertAfter$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrop$Rotate$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrop$InsertAfter$containerStyles, + $author$project$DnDList$OperationsOnDrop$Rotate$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrop$InsertAfter$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrop$InsertAfter$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrop$Rotate$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrop$Rotate$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrop$InsertBefore$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrop$InsertBefore$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrop$Swap$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrop$Swap$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrop$Swap$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14788,23 +16392,23 @@ var $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles = function ( A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrop$InsertBefore$ghostView = F2( +var $author$project$DnDList$OperationsOnDrop$Swap$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrop$InsertBefore$system.be(dnd)); + $author$project$DnDList$OperationsOnDrop$Swap$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles($author$project$Config$OperationsOnDrop$InsertBefore$dragColor), - $author$project$Config$OperationsOnDrop$InsertBefore$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrop$Swap$itemStyles($author$project$DnDList$OperationsOnDrop$Swap$dragColor), + $author$project$DnDList$OperationsOnDrop$Swap$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14813,23 +16417,23 @@ var $author$project$Config$OperationsOnDrop$InsertBefore$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrop$InsertBefore$itemView = F3( +var $author$project$DnDList$OperationsOnDrop$Swap$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; - var itemId = 'insertbefore-' + value; - var _v1 = $author$project$Config$OperationsOnDrop$InsertBefore$system.be(dnd); + var value = _v0.aC; + var color = _v0.a_; + var itemId = 'swap-' + value; + var _v1 = $author$project$DnDList$OperationsOnDrop$Swap$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$InsertBefore$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Swap$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$Swap$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14839,8 +16443,8 @@ var $author$project$Config$OperationsOnDrop$InsertBefore$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles($author$project$Config$OperationsOnDrop$InsertBefore$dropColor), - A2($author$project$Config$OperationsOnDrop$InsertBefore$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Swap$itemStyles($author$project$DnDList$OperationsOnDrop$Swap$dropColor), + A2($author$project$DnDList$OperationsOnDrop$Swap$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14849,7 +16453,7 @@ var $author$project$Config$OperationsOnDrop$InsertBefore$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles($author$project$Config$OperationsOnDrop$InsertBefore$dropColor)), + $author$project$DnDList$OperationsOnDrop$Swap$itemStyles($author$project$DnDList$OperationsOnDrop$Swap$dropColor)), _List_Nil)); } else { return A2( @@ -14858,42 +16462,42 @@ var $author$project$Config$OperationsOnDrop$InsertBefore$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$InsertBefore$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$InsertBefore$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Swap$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$Swap$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrop$InsertBefore$view = function (model) { +var $author$project$DnDList$OperationsOnDrop$Swap$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrop$InsertBefore$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrop$Swap$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrop$InsertBefore$containerStyles, + $author$project$DnDList$OperationsOnDrop$Swap$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrop$InsertBefore$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrop$InsertBefore$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrop$Swap$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrop$Swap$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrop$Rotate$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrop$Rotate$containerStyles = _List_fromArray( +var $author$project$DnDList$OperationsOnDrop$Unaltered$ResetColors = {$: 1}; +var $author$project$DnDList$OperationsOnDrop$Unaltered$containerStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center') ]); -var $author$project$Config$OperationsOnDrop$Rotate$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrop$Unaltered$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), @@ -14907,23 +16511,23 @@ var $author$project$Config$OperationsOnDrop$Rotate$itemStyles = function (color) A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrop$Rotate$ghostView = F2( +var $author$project$DnDList$OperationsOnDrop$Unaltered$ghostView = F2( function (dnd, items) { var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrop$Rotate$system.be(dnd)); + $author$project$DnDList$OperationsOnDrop$Unaltered$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + var value = maybeDragItem.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrop$Rotate$itemStyles($author$project$Config$OperationsOnDrop$Rotate$dragColor), - $author$project$Config$OperationsOnDrop$Rotate$system.c$(dnd)), + $author$project$DnDList$OperationsOnDrop$Unaltered$itemStyles($author$project$DnDList$OperationsOnDrop$Unaltered$dragColor), + $author$project$DnDList$OperationsOnDrop$Unaltered$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -14932,23 +16536,23 @@ var $author$project$Config$OperationsOnDrop$Rotate$ghostView = F2( return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrop$Rotate$itemView = F3( +var $author$project$DnDList$OperationsOnDrop$Unaltered$itemView = F3( function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; - var itemId = 'rotateout-' + value; - var _v1 = $author$project$Config$OperationsOnDrop$Rotate$system.be(dnd); + var value = _v0.aC; + var color = _v0.a_; + var itemId = 'unaltered-' + value; + var _v1 = $author$project$DnDList$OperationsOnDrop$Unaltered$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Rotate$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$Rotate$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Unaltered$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$Unaltered$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14958,8 +16562,8 @@ var $author$project$Config$OperationsOnDrop$Rotate$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Rotate$itemStyles($author$project$Config$OperationsOnDrop$Rotate$dropColor), - A2($author$project$Config$OperationsOnDrop$Rotate$system.cU, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Unaltered$itemStyles($author$project$DnDList$OperationsOnDrop$Unaltered$dropColor), + A2($author$project$DnDList$OperationsOnDrop$Unaltered$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -14968,7 +16572,7 @@ var $author$project$Config$OperationsOnDrop$Rotate$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrop$Rotate$itemStyles($author$project$Config$OperationsOnDrop$Rotate$dropColor)), + $author$project$DnDList$OperationsOnDrop$Unaltered$itemStyles($author$project$DnDList$OperationsOnDrop$Unaltered$dropColor)), _List_Nil)); } else { return A2( @@ -14977,47 +16581,165 @@ var $author$project$Config$OperationsOnDrop$Rotate$itemView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Rotate$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$Rotate$system.cT, index, itemId))), + $author$project$DnDList$OperationsOnDrop$Unaltered$itemStyles(color), + A2($author$project$DnDList$OperationsOnDrop$Unaltered$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrop$Rotate$view = function (model) { +var $author$project$DnDList$OperationsOnDrop$Unaltered$view = function (model) { return A2( $elm$html$Html$section, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrop$Rotate$ResetColors) + $elm$html$Html$Events$onMouseDown($author$project$DnDList$OperationsOnDrop$Unaltered$ResetColors) ]), _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrop$Rotate$containerStyles, + $author$project$DnDList$OperationsOnDrop$Unaltered$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrop$Rotate$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrop$Rotate$ghostView, model.aa, model.au) + $author$project$DnDList$OperationsOnDrop$Unaltered$itemView(model.Z), + model.av)), + A2($author$project$DnDList$OperationsOnDrop$Unaltered$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrop$Swap$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrop$Swap$containerStyles = _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'center') - ]); -var $author$project$Config$OperationsOnDrop$Swap$itemStyles = function (color) { +var $author$project$DnDList$OperationsOnDrop$Parent$demoView = function (example) { + switch (example.$) { + case 0: + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$OperationsOnDrop$Parent$InsertAfterMsg, + $author$project$DnDList$OperationsOnDrop$InsertAfter$view(mo)); + case 1: + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$OperationsOnDrop$Parent$InsertBeforeMsg, + $author$project$DnDList$OperationsOnDrop$InsertBefore$view(mo)); + case 2: + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$OperationsOnDrop$Parent$RotateMsg, + $author$project$DnDList$OperationsOnDrop$Rotate$view(mo)); + case 3: + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$OperationsOnDrop$Parent$SwapMsg, + $author$project$DnDList$OperationsOnDrop$Swap$view(mo)); + default: + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$OperationsOnDrop$Parent$UnalteredMsg, + $author$project$DnDList$OperationsOnDrop$Unaltered$view(mo)); + } +}; +var $author$project$DnDList$OperationsOnDrop$Parent$info = function (example) { + switch (example.$) { + case 0: + return 'Insert after'; + case 1: + return 'Insert before'; + case 2: + return 'Rotate'; + case 3: + return 'Swap'; + default: + return 'Unaltered'; + } +}; +var $author$project$DnDList$OperationsOnDrop$Parent$demoWrapperView = F3( + function (currentId, id, example) { + return A2( + $elm$html$Html$div, + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'margin', '4em 0') + ]), + _List_fromArray( + [ + $author$project$DnDList$OperationsOnDrop$Parent$demoView(example), + A2( + $elm$html$Html$div, + _List_fromArray( + [ + $elm$html$Html$Attributes$classList( + _List_fromArray( + [ + _Utils_Tuple2('link', true), + _Utils_Tuple2( + 'is-active', + _Utils_eq(id, currentId)) + ])), + $elm$html$Html$Events$onClick( + $author$project$DnDList$OperationsOnDrop$Parent$LinkClicked(id)) + ]), + _List_fromArray( + [ + $elm$html$Html$text( + $author$project$DnDList$OperationsOnDrop$Parent$info(example)) + ])) + ])); + }); +var $author$project$DnDList$OperationsOnDrop$Parent$view = function (model) { + return A2( + $elm$html$Html$section, + _List_Nil, + A2( + $elm$core$List$indexedMap, + $author$project$DnDList$OperationsOnDrop$Parent$demoWrapperView(model.a7), + model.at)); +}; +var $author$project$DnDList$Parent$demoView = function (model) { + switch (model.$) { + case 0: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$Parent$MovementMsg, + $author$project$DnDList$Movement$Parent$view(mo)); + case 1: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$Parent$OperationsOnDragMsg, + $author$project$DnDList$OperationsOnDrag$Parent$view(mo)); + case 2: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$Parent$OperationsOnDropMsg, + $author$project$DnDList$OperationsOnDrop$Parent$view(mo)); + default: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDList$Parent$HookCommandsMsg, + $author$project$DnDList$HookCommands$Parent$view(mo)); + } +}; +var $author$project$DnDListGroups$HookCommands$Parent$LinkClicked = function (a) { + return {$: 0, a: a}; +}; +var $author$project$DnDListGroups$HookCommands$DetectDrop$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), + A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), A2($elm$html$Html$Attributes$style, 'color', 'white'), A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), + A2($elm$html$Html$Attributes$style, 'font-size', '1.2em'), A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), @@ -15026,59 +16748,124 @@ var $author$project$Config$OperationsOnDrop$Swap$itemStyles = function (color) { A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrop$Swap$ghostView = F2( +var $author$project$DnDListGroups$HookCommands$DetectDrop$maybeDragItem = F2( function (dnd, items) { - var maybeDragItem = A2( + return A2( $elm$core$Maybe$andThen, - function (_v1) { - var dragIndex = _v1.a9; + function (_v0) { + var dragIndex = _v0.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrop$Swap$system.be(dnd)); - if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + $author$project$DnDListGroups$HookCommands$DetectDrop$system.bX(dnd)); + }); +var $author$project$DnDListGroups$HookCommands$DetectDrop$ghostView = F2( + function (dnd, items) { + var _v0 = A2($author$project$DnDListGroups$HookCommands$DetectDrop$maybeDragItem, dnd, items); + if (!_v0.$) { + var item = _v0.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrop$Swap$itemStyles($author$project$Config$OperationsOnDrop$Swap$dragColor), - $author$project$Config$OperationsOnDrop$Swap$system.c$(dnd)), + $author$project$DnDListGroups$HookCommands$DetectDrop$itemStyles(item.a_), + $author$project$DnDListGroups$HookCommands$DetectDrop$system.bS(dnd)), _List_fromArray( [ - $elm$html$Html$text(value) + $elm$html$Html$text(item.aC) ])); } else { return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrop$Swap$itemView = F3( - function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; - var itemId = 'swap-' + value; - var _v1 = $author$project$Config$OperationsOnDrop$Swap$system.be(dnd); - if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; - return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( +var $author$project$DnDListGroups$HookCommands$DetectDrop$calculateOffset = F3( + function (index, group, list) { + calculateOffset: + while (true) { + if (!list.b) { + return 0; + } else { + var x = list.a; + var xs = list.b; + if (_Utils_eq(x.x, group)) { + return index; + } else { + var $temp$index = index + 1, + $temp$group = group, + $temp$list = xs; + index = $temp$index; + group = $temp$group; + list = $temp$list; + continue calculateOffset; + } + } + } + }); +var $author$project$DnDListGroups$HookCommands$DetectDrop$groupStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') + ]); +var $author$project$DnDListGroups$HookCommands$DetectDrop$auxiliaryItemStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'flex-grow', '1'), + A2($elm$html$Html$Attributes$style, 'box-sizing', 'border-box'), + A2($elm$html$Html$Attributes$style, 'margin-right', '1.5rem'), + A2($elm$html$Html$Attributes$style, 'width', 'auto'), + A2($elm$html$Html$Attributes$style, 'height', '50px'), + A2($elm$html$Html$Attributes$style, 'min-width', '50px'), + A2($elm$html$Html$Attributes$style, 'border', '3px dashed gray'), + A2($elm$html$Html$Attributes$style, 'background-color', 'transparent') + ]); +var $author$project$DnDListGroups$HookCommands$DetectDrop$dropColor = 'dimgray'; +var $author$project$DnDListGroups$HookCommands$DetectDrop$itemView = F4( + function (model, offset, localIndex, _v0) { + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; + var globalIndex = offset + localIndex; + var itemId = 'insertbefore-' + $elm$core$String$fromInt(globalIndex); + var _v1 = _Utils_Tuple2( + $author$project$DnDListGroups$HookCommands$DetectDrop$system.bX(model.Z), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$maybeDragItem, model.Z, model.av)); + if ((!_v1.a.$) && (!_v1.b.$)) { + var dragIndex = _v1.a.a.c; + var dropIndex = _v1.a.a.h; + var dragItem = _v1.b.a; + return ((value === '') && (!_Utils_eq(group, dragItem.x))) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDListGroups$HookCommands$DetectDrop$auxiliaryItemStyles, + A2($author$project$DnDListGroups$HookCommands$DetectDrop$system.bM, globalIndex, itemId))), + _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.x)) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDListGroups$HookCommands$DetectDrop$auxiliaryItemStyles), + _List_Nil) : (((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Swap$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$Swap$system.cU, index, itemId))), + $author$project$DnDListGroups$HookCommands$DetectDrop$itemStyles(color), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) - ])) : (((!_Utils_eq(index, dragIndex)) && _Utils_eq(index, dropIndex)) ? A2( + ])) : (((!_Utils_eq(globalIndex, dragIndex)) && _Utils_eq(globalIndex, dropIndex)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Swap$itemStyles($author$project$Config$OperationsOnDrop$Swap$dropColor), - A2($author$project$Config$OperationsOnDrop$Swap$system.cU, index, itemId))), + $author$project$DnDListGroups$HookCommands$DetectDrop$itemStyles($author$project$DnDListGroups$HookCommands$DetectDrop$dropColor), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15087,56 +16874,109 @@ var $author$project$Config$OperationsOnDrop$Swap$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrop$Swap$itemStyles($author$project$Config$OperationsOnDrop$Swap$dropColor)), - _List_Nil)); + $author$project$DnDListGroups$HookCommands$DetectDrop$itemStyles($author$project$DnDListGroups$HookCommands$DetectDrop$dropColor)), + _List_Nil)))); } else { - return A2( + return (value === '') ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDListGroups$HookCommands$DetectDrop$auxiliaryItemStyles), + _List_Nil) : A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Swap$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$Swap$system.cT, index, itemId))), + $author$project$DnDListGroups$HookCommands$DetectDrop$itemStyles(color), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrop$Swap$view = function (model) { +var $author$project$DnDListGroups$HookCommands$DetectDrop$groupView = F2( + function (model, currentGroup) { + return A2( + $elm$html$Html$div, + $author$project$DnDListGroups$HookCommands$DetectDrop$groupStyles, + A2( + $elm$core$List$indexedMap, + A2( + $author$project$DnDListGroups$HookCommands$DetectDrop$itemView, + model, + A3($author$project$DnDListGroups$HookCommands$DetectDrop$calculateOffset, 0, currentGroup, model.av)), + A2( + $elm$core$List$filter, + function (_v0) { + var group = _v0.x; + return _Utils_eq(group, currentGroup); + }, + model.av))); + }); +var $author$project$DnDListGroups$HookCommands$DetectDrop$historyView = function (history) { + var eventView = function (_v0) { + var i = _v0.a; + var j = _v0.b; + return A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text( + $elm$core$String$fromInt(i) + (' ⟷ ' + $elm$core$String$fromInt(j))) + ])); + }; return A2( - $elm$html$Html$section, + $elm$html$Html$ul, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrop$Swap$ResetColors) + A2($elm$html$Html$Attributes$style, 'list-style', 'none'), + A2($elm$html$Html$Attributes$style, 'width', '100px'), + A2($elm$html$Html$Attributes$style, 'font-family', 'monospace') ]), + A2( + $elm$core$List$cons, + A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text('i ⟷ j') + ])), + A2($elm$core$List$map, eventView, history))); +}; +var $author$project$DnDListGroups$HookCommands$DetectDrop$view = function (model) { + return A2( + $elm$html$Html$section, + _List_Nil, _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrop$Swap$containerStyles, - A2( - $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrop$Swap$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrop$Swap$ghostView, model.aa, model.au) + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex') + ]), + _List_fromArray( + [ + $author$project$DnDListGroups$HookCommands$DetectDrop$historyView(model.aK), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$groupView, model, 1), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$groupView, model, 2) + ])), + A2($author$project$DnDListGroups$HookCommands$DetectDrop$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrop$Unaltered$ResetColors = {$: 1}; -var $author$project$Config$OperationsOnDrop$Unaltered$containerStyles = _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-wrap', 'wrap'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'center') - ]); -var $author$project$Config$OperationsOnDrop$Unaltered$itemStyles = function (color) { +var $author$project$DnDListGroups$HookCommands$DetectReorder$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'background-color', color), + A2($elm$html$Html$Attributes$style, 'border-radius', '8px'), A2($elm$html$Html$Attributes$style, 'color', 'white'), A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), + A2($elm$html$Html$Attributes$style, 'font-size', '1.2em'), A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'align-items', 'center'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), @@ -15145,59 +16985,124 @@ var $author$project$Config$OperationsOnDrop$Unaltered$itemStyles = function (col A2($elm$html$Html$Attributes$style, 'height', '50px') ]); }; -var $author$project$Config$OperationsOnDrop$Unaltered$ghostView = F2( +var $author$project$DnDListGroups$HookCommands$DetectReorder$maybeDragItem = F2( function (dnd, items) { - var maybeDragItem = A2( + return A2( $elm$core$Maybe$andThen, - function (_v1) { - var dragIndex = _v1.a9; + function (_v0) { + var dragIndex = _v0.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Config$OperationsOnDrop$Unaltered$system.be(dnd)); - if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; + $author$project$DnDListGroups$HookCommands$DetectReorder$system.bX(dnd)); + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$ghostView = F2( + function (dnd, items) { + var _v0 = A2($author$project$DnDListGroups$HookCommands$DetectReorder$maybeDragItem, dnd, items); + if (!_v0.$) { + var item = _v0.a; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$Config$OperationsOnDrop$Unaltered$itemStyles($author$project$Config$OperationsOnDrop$Unaltered$dragColor), - $author$project$Config$OperationsOnDrop$Unaltered$system.c$(dnd)), + $author$project$DnDListGroups$HookCommands$DetectReorder$itemStyles(item.a_), + $author$project$DnDListGroups$HookCommands$DetectReorder$system.bS(dnd)), _List_fromArray( [ - $elm$html$Html$text(value) + $elm$html$Html$text(item.aC) ])); } else { return $elm$html$Html$text(''); } }); -var $author$project$Config$OperationsOnDrop$Unaltered$itemView = F3( - function (dnd, index, _v0) { - var value = _v0.aB; - var color = _v0.aV; - var itemId = 'unaltered-' + value; - var _v1 = $author$project$Config$OperationsOnDrop$Unaltered$system.be(dnd); - if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; - return ((!_Utils_eq(index, dragIndex)) && (!_Utils_eq(index, dropIndex))) ? A2( +var $author$project$DnDListGroups$HookCommands$DetectReorder$calculateOffset = F3( + function (index, group, list) { + calculateOffset: + while (true) { + if (!list.b) { + return 0; + } else { + var x = list.a; + var xs = list.b; + if (_Utils_eq(x.x, group)) { + return index; + } else { + var $temp$index = index + 1, + $temp$group = group, + $temp$list = xs; + index = $temp$index; + group = $temp$group; + list = $temp$list; + continue calculateOffset; + } + } + } + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$groupStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex'), + A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), + A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), + A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') + ]); +var $author$project$DnDListGroups$HookCommands$DetectReorder$auxiliaryItemStyles = _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'flex-grow', '1'), + A2($elm$html$Html$Attributes$style, 'box-sizing', 'border-box'), + A2($elm$html$Html$Attributes$style, 'margin-right', '1.5rem'), + A2($elm$html$Html$Attributes$style, 'width', 'auto'), + A2($elm$html$Html$Attributes$style, 'height', '50px'), + A2($elm$html$Html$Attributes$style, 'min-width', '50px'), + A2($elm$html$Html$Attributes$style, 'border', '3px dashed gray'), + A2($elm$html$Html$Attributes$style, 'background-color', 'transparent') + ]); +var $author$project$DnDListGroups$HookCommands$DetectReorder$dropColor = 'dimgray'; +var $author$project$DnDListGroups$HookCommands$DetectReorder$itemView = F4( + function (model, offset, localIndex, _v0) { + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; + var globalIndex = offset + localIndex; + var itemId = 'insertbefore-' + $elm$core$String$fromInt(globalIndex); + var _v1 = _Utils_Tuple2( + $author$project$DnDListGroups$HookCommands$DetectReorder$system.bX(model.Z), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$maybeDragItem, model.Z, model.av)); + if ((!_v1.a.$) && (!_v1.b.$)) { + var dragIndex = _v1.a.a.c; + var dropIndex = _v1.a.a.h; + var dragItem = _v1.b.a; + return ((value === '') && (!_Utils_eq(group, dragItem.x))) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + _Utils_ap( + $author$project$DnDListGroups$HookCommands$DetectReorder$auxiliaryItemStyles, + A2($author$project$DnDListGroups$HookCommands$DetectReorder$system.bM, globalIndex, itemId))), + _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.x)) ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDListGroups$HookCommands$DetectReorder$auxiliaryItemStyles), + _List_Nil) : (((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Unaltered$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$Unaltered$system.cU, index, itemId))), + $author$project$DnDListGroups$HookCommands$DetectReorder$itemStyles(color), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) - ])) : (((!_Utils_eq(index, dragIndex)) && _Utils_eq(index, dropIndex)) ? A2( + ])) : (((!_Utils_eq(globalIndex, dragIndex)) && _Utils_eq(globalIndex, dropIndex)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Unaltered$itemStyles($author$project$Config$OperationsOnDrop$Unaltered$dropColor), - A2($author$project$Config$OperationsOnDrop$Unaltered$system.cU, index, itemId))), + $author$project$DnDListGroups$HookCommands$DetectReorder$itemStyles($author$project$DnDListGroups$HookCommands$DetectReorder$dropColor), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15206,91 +17111,124 @@ var $author$project$Config$OperationsOnDrop$Unaltered$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$Config$OperationsOnDrop$Unaltered$itemStyles($author$project$Config$OperationsOnDrop$Unaltered$dropColor)), - _List_Nil)); + $author$project$DnDListGroups$HookCommands$DetectReorder$itemStyles($author$project$DnDListGroups$HookCommands$DetectReorder$dropColor)), + _List_Nil)))); } else { - return A2( + return (value === '') ? A2( + $elm$html$Html$div, + A2( + $elm$core$List$cons, + $elm$html$Html$Attributes$id(itemId), + $author$project$DnDListGroups$HookCommands$DetectReorder$auxiliaryItemStyles), + _List_Nil) : A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$Config$OperationsOnDrop$Unaltered$itemStyles(color), - A2($author$project$Config$OperationsOnDrop$Unaltered$system.cT, index, itemId))), + $author$project$DnDListGroups$HookCommands$DetectReorder$itemStyles(color), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$Config$OperationsOnDrop$Unaltered$view = function (model) { +var $author$project$DnDListGroups$HookCommands$DetectReorder$groupView = F2( + function (model, currentGroup) { + return A2( + $elm$html$Html$div, + $author$project$DnDListGroups$HookCommands$DetectReorder$groupStyles, + A2( + $elm$core$List$indexedMap, + A2( + $author$project$DnDListGroups$HookCommands$DetectReorder$itemView, + model, + A3($author$project$DnDListGroups$HookCommands$DetectReorder$calculateOffset, 0, currentGroup, model.av)), + A2( + $elm$core$List$filter, + function (_v0) { + var group = _v0.x; + return _Utils_eq(group, currentGroup); + }, + model.av))); + }); +var $author$project$DnDListGroups$HookCommands$DetectReorder$historyView = function (history) { + var eventView = function (_v0) { + var i = _v0.a; + var j = _v0.b; + return A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text( + $elm$core$String$fromInt(i) + (' ⟷ ' + $elm$core$String$fromInt(j))) + ])); + }; return A2( - $elm$html$Html$section, + $elm$html$Html$ul, _List_fromArray( [ - $elm$html$Html$Events$onMouseDown($author$project$Config$OperationsOnDrop$Unaltered$ResetColors) + A2($elm$html$Html$Attributes$style, 'list-style', 'none'), + A2($elm$html$Html$Attributes$style, 'width', '100px'), + A2($elm$html$Html$Attributes$style, 'font-family', 'monospace') ]), + A2( + $elm$core$List$cons, + A2( + $elm$html$Html$li, + _List_Nil, + _List_fromArray( + [ + $elm$html$Html$text('i ⟷ j') + ])), + A2($elm$core$List$map, eventView, history))); +}; +var $author$project$DnDListGroups$HookCommands$DetectReorder$view = function (model) { + return A2( + $elm$html$Html$section, + _List_Nil, _List_fromArray( [ A2( $elm$html$Html$div, - $author$project$Config$OperationsOnDrop$Unaltered$containerStyles, - A2( - $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrop$Unaltered$itemView(model.aa), - model.au)), - A2($author$project$Config$OperationsOnDrop$Unaltered$ghostView, model.aa, model.au) + _List_fromArray( + [ + A2($elm$html$Html$Attributes$style, 'display', 'flex') + ]), + _List_fromArray( + [ + $author$project$DnDListGroups$HookCommands$DetectReorder$historyView(model.aK), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$groupView, model, 1), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$groupView, model, 2) + ])), + A2($author$project$DnDListGroups$HookCommands$DetectReorder$ghostView, model.Z, model.av) ])); }; -var $author$project$Config$OperationsOnDrop$Root$demoView = function (example) { - switch (example.$) { - case 0: - var mo = example.a; - return A2( - $elm$html$Html$map, - $author$project$Config$OperationsOnDrop$Root$InsertAfterMsg, - $author$project$Config$OperationsOnDrop$InsertAfter$view(mo)); - case 1: - var mo = example.a; - return A2( - $elm$html$Html$map, - $author$project$Config$OperationsOnDrop$Root$InsertBeforeMsg, - $author$project$Config$OperationsOnDrop$InsertBefore$view(mo)); - case 2: - var mo = example.a; - return A2( - $elm$html$Html$map, - $author$project$Config$OperationsOnDrop$Root$RotateMsg, - $author$project$Config$OperationsOnDrop$Rotate$view(mo)); - case 3: - var mo = example.a; - return A2( - $elm$html$Html$map, - $author$project$Config$OperationsOnDrop$Root$SwapMsg, - $author$project$Config$OperationsOnDrop$Swap$view(mo)); - default: - var mo = example.a; - return A2( - $elm$html$Html$map, - $author$project$Config$OperationsOnDrop$Root$UnalteredMsg, - $author$project$Config$OperationsOnDrop$Unaltered$view(mo)); +var $author$project$DnDListGroups$HookCommands$Parent$demoView = function (example) { + if (!example.$) { + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDListGroups$HookCommands$Parent$DetectDropMsg, + $author$project$DnDListGroups$HookCommands$DetectDrop$view(mo)); + } else { + var mo = example.a; + return A2( + $elm$html$Html$map, + $author$project$DnDListGroups$HookCommands$Parent$DetectReorderMsg, + $author$project$DnDListGroups$HookCommands$DetectReorder$view(mo)); } }; -var $author$project$Config$OperationsOnDrop$Root$info = function (example) { - switch (example.$) { - case 0: - return 'Insert after'; - case 1: - return 'Insert before'; - case 2: - return 'Rotate'; - case 3: - return 'Swap'; - default: - return 'Unaltered'; +var $author$project$DnDListGroups$HookCommands$Parent$info = function (example) { + if (!example.$) { + return 'Detect drop'; + } else { + return 'Detect reorder'; } }; -var $author$project$Config$OperationsOnDrop$Root$demoWrapperView = F3( +var $author$project$DnDListGroups$HookCommands$Parent$demoWrapperView = F3( function (currentId, id, example) { return A2( $elm$html$Html$div, @@ -15303,7 +17241,7 @@ var $author$project$Config$OperationsOnDrop$Root$demoWrapperView = F3( ]), _List_fromArray( [ - $author$project$Config$OperationsOnDrop$Root$demoView(example), + $author$project$DnDListGroups$HookCommands$Parent$demoView(example), A2( $elm$html$Html$div, _List_fromArray( @@ -15317,51 +17255,29 @@ var $author$project$Config$OperationsOnDrop$Root$demoWrapperView = F3( _Utils_eq(id, currentId)) ])), $elm$html$Html$Events$onClick( - $author$project$Config$OperationsOnDrop$Root$LinkClicked(id)) + $author$project$DnDListGroups$HookCommands$Parent$LinkClicked(id)) ]), _List_fromArray( [ $elm$html$Html$text( - $author$project$Config$OperationsOnDrop$Root$info(example)) + $author$project$DnDListGroups$HookCommands$Parent$info(example)) ])) ])); }); -var $author$project$Config$OperationsOnDrop$Root$view = function (model) { +var $author$project$DnDListGroups$HookCommands$Parent$view = function (model) { return A2( $elm$html$Html$section, _List_Nil, A2( $elm$core$List$indexedMap, - $author$project$Config$OperationsOnDrop$Root$demoWrapperView(model.at), - model.Q)); -}; -var $author$project$Config$Root$demoView = function (model) { - switch (model.$) { - case 0: - var mo = model.a; - return A2( - $elm$html$Html$map, - $author$project$Config$Root$MovementMsg, - $author$project$Config$Movement$Root$view(mo)); - case 1: - var mo = model.a; - return A2( - $elm$html$Html$map, - $author$project$Config$Root$OperationsOnDragMsg, - $author$project$Config$OperationsOnDrag$Root$view(mo)); - default: - var mo = model.a; - return A2( - $elm$html$Html$map, - $author$project$Config$Root$OperationsOnDropMsg, - $author$project$Config$OperationsOnDrop$Root$view(mo)); - } + $author$project$DnDListGroups$HookCommands$Parent$demoWrapperView(model.a7), + model.at)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$LinkClicked = function (a) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$LinkClicked = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -15375,27 +17291,27 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles = funct A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dragColor), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemStyles($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dragColor), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -15404,7 +17320,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$ghostView = functi return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -15413,7 +17329,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$calculateOffset = } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -15427,13 +17343,13 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$calculateOffset = } } }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'flex-grow', '1'), A2($elm$html$Html$Attributes$style, 'box-sizing', 'border-box'), @@ -15444,42 +17360,42 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyle A2($elm$html$Html$Attributes$style, 'border', '3px dashed gray'), A2($elm$html$Html$Attributes$style, 'background-color', 'transparent') ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemView = F4( function (model, offset, localIndex, _v0) { - var group = _v0.t; - var value = _v0.aB; - var color = _v0.aV; + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'insertafter-' + $elm$core$String$fromInt(globalIndex); var _v1 = _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.be(model.aa), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$maybeDragItem(model)); + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bX(model.Z), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$maybeDragItem(model)); if ((!_v1.a.$) && (!_v1.b.$)) { - var dragIndex = _v1.a.a.a9; - var dropIndex = _v1.a.a.cV; + var dragIndex = _v1.a.a.c; + var dropIndex = _v1.a.a.h; var dragItem = _v1.b.a; - return ((value === '') && (!_Utils_eq(group, dragItem.t))) ? A2( + return ((value === '') && (!_Utils_eq(group, dragItem.x))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles, - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.cU, globalIndex, itemId))), - _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.t)) ? A2( + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles, + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bM, globalIndex, itemId))), + _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.x)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles), _List_Nil) : (((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15489,8 +17405,8 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dropColor), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemStyles($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dropColor), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15499,7 +17415,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$dropColor)), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemStyles($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$dropColor)), _List_Nil)))); } else { return (value === '') ? A2( @@ -15507,63 +17423,63 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$auxiliaryItemStyles), _List_Nil) : A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$groupStyles, + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$itemView, + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$ResetColors), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$ResetColors), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertAfter$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertAfter$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -15577,27 +17493,27 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles = func A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dragColor), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemStyles($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dragColor), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -15606,7 +17522,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$ghostView = funct return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -15615,7 +17531,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$calculateOffset = } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -15629,13 +17545,13 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$calculateOffset = } } }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'flex-grow', '1'), A2($elm$html$Html$Attributes$style, 'box-sizing', 'border-box'), @@ -15646,42 +17562,42 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyl A2($elm$html$Html$Attributes$style, 'border', '3px dashed gray'), A2($elm$html$Html$Attributes$style, 'background-color', 'transparent') ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemView = F4( function (model, offset, localIndex, _v0) { - var group = _v0.t; - var value = _v0.aB; - var color = _v0.aV; + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'insertbefore-' + $elm$core$String$fromInt(globalIndex); var _v1 = _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.be(model.aa), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$maybeDragItem(model)); + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bX(model.Z), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$maybeDragItem(model)); if ((!_v1.a.$) && (!_v1.b.$)) { - var dragIndex = _v1.a.a.a9; - var dropIndex = _v1.a.a.cV; + var dragIndex = _v1.a.a.c; + var dropIndex = _v1.a.a.h; var dragItem = _v1.b.a; - return ((value === '') && (!_Utils_eq(group, dragItem.t))) ? A2( + return ((value === '') && (!_Utils_eq(group, dragItem.x))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles, - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.cU, globalIndex, itemId))), - _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.t)) ? A2( + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles, + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bM, globalIndex, itemId))), + _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.x)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles), _List_Nil) : (((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15691,8 +17607,8 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dropColor), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemStyles($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dropColor), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15701,7 +17617,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$dropColor)), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemStyles($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$dropColor)), _List_Nil)))); } else { return (value === '') ? A2( @@ -15709,63 +17625,63 @@ var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$auxiliaryItemStyles), _List_Nil) : A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$groupStyles, + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$itemView, + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$ResetColors), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$ResetColors), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrag$InsertBefore$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrag$InsertBefore$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -15779,27 +17695,27 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemStyles = function ( A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrag$Rotate$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrag$Rotate$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrag$Rotate$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrag$Rotate$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemStyles($author$project$ConfigGroups$OperationsOnDrag$Rotate$dragColor), - $author$project$ConfigGroups$OperationsOnDrag$Rotate$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemStyles($author$project$DnDListGroups$OperationsOnDrag$Rotate$dragColor), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -15808,7 +17724,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$ghostView = function (m return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -15817,7 +17733,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$calculateOffset = F3( } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -15831,30 +17747,30 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$calculateOffset = F3( } } }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemView = F4( function (model, offset, localIndex, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'rotate-' + $elm$core$String$fromInt(globalIndex); - var _v1 = $author$project$ConfigGroups$OperationsOnDrag$Rotate$system.be(model.aa); + var _v1 = $author$project$DnDListGroups$OperationsOnDrag$Rotate$system.bX(model.Z); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$Rotate$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$Rotate$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -15863,7 +17779,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemStyles($author$project$ConfigGroups$OperationsOnDrag$Rotate$dropColor)), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemStyles($author$project$DnDListGroups$OperationsOnDrag$Rotate$dropColor)), _List_Nil); } else { return A2( @@ -15872,56 +17788,56 @@ var $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$Rotate$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$Rotate$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrag$Rotate$groupStyles, + $author$project$DnDListGroups$OperationsOnDrag$Rotate$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrag$Rotate$itemView, + $author$project$DnDListGroups$OperationsOnDrag$Rotate$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrag$Rotate$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrag$Rotate$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrag$Rotate$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrag$Rotate$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrag$Rotate$ResetColors), - $author$project$ConfigGroups$OperationsOnDrag$Rotate$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrag$Rotate$ResetColors), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrag$Rotate$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrag$Rotate$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrag$Rotate$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrag$Rotate$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrag$Rotate$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrag$Rotate$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrag$Rotate$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrag$Rotate$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrag$Swap$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -15935,27 +17851,27 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$itemStyles = function (co A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrag$Swap$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrag$Swap$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrag$Swap$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrag$Swap$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrag$Swap$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrag$Swap$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$Swap$itemStyles($author$project$ConfigGroups$OperationsOnDrag$Swap$dragColor), - $author$project$ConfigGroups$OperationsOnDrag$Swap$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrag$Swap$itemStyles($author$project$DnDListGroups$OperationsOnDrag$Swap$dragColor), + $author$project$DnDListGroups$OperationsOnDrag$Swap$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -15964,7 +17880,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$ghostView = function (mod return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrag$Swap$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -15973,7 +17889,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$calculateOffset = F3( } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -15987,30 +17903,30 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$calculateOffset = F3( } } }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$itemView = F4( function (model, offset, localIndex, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'swap-' + $elm$core$String$fromInt(globalIndex); - var _v1 = $author$project$ConfigGroups$OperationsOnDrag$Swap$system.be(model.aa); + var _v1 = $author$project$DnDListGroups$OperationsOnDrag$Swap$system.bX(model.Z); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$Swap$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$Swap$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$Swap$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$Swap$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16019,7 +17935,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrag$Swap$itemStyles($author$project$ConfigGroups$OperationsOnDrag$Swap$dropColor)), + $author$project$DnDListGroups$OperationsOnDrag$Swap$itemStyles($author$project$DnDListGroups$OperationsOnDrag$Swap$dropColor)), _List_Nil); } else { return A2( @@ -16028,83 +17944,83 @@ var $author$project$ConfigGroups$OperationsOnDrag$Swap$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrag$Swap$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrag$Swap$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrag$Swap$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrag$Swap$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrag$Swap$groupStyles, + $author$project$DnDListGroups$OperationsOnDrag$Swap$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrag$Swap$itemView, + $author$project$DnDListGroups$OperationsOnDrag$Swap$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrag$Swap$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrag$Swap$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrag$Swap$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrag$Swap$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrag$Swap$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrag$Swap$ResetColors), - $author$project$ConfigGroups$OperationsOnDrag$Swap$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrag$Swap$ResetColors), + $author$project$DnDListGroups$OperationsOnDrag$Swap$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrag$Swap$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrag$Swap$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrag$Swap$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrag$Swap$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrag$Swap$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrag$Swap$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrag$Swap$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrag$Swap$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$demoView = function (example) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$demoView = function (example) { switch (example.$) { case 0: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertAfterMsg, - $author$project$ConfigGroups$OperationsOnDrag$InsertAfter$view(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertAfterMsg, + $author$project$DnDListGroups$OperationsOnDrag$InsertAfter$view(mo)); case 1: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$InsertBeforeMsg, - $author$project$ConfigGroups$OperationsOnDrag$InsertBefore$view(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$InsertBeforeMsg, + $author$project$DnDListGroups$OperationsOnDrag$InsertBefore$view(mo)); case 2: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$RotateMsg, - $author$project$ConfigGroups$OperationsOnDrag$Rotate$view(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$RotateMsg, + $author$project$DnDListGroups$OperationsOnDrag$Rotate$view(mo)); default: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrag$Root$SwapMsg, - $author$project$ConfigGroups$OperationsOnDrag$Swap$view(mo)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$SwapMsg, + $author$project$DnDListGroups$OperationsOnDrag$Swap$view(mo)); } }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$info = function (example) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$info = function (example) { switch (example.$) { case 0: return 'Insert after'; @@ -16116,7 +18032,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$info = function (example) return 'Swap'; } }; -var $author$project$ConfigGroups$OperationsOnDrag$Root$demoWrapperView = F3( +var $author$project$DnDListGroups$OperationsOnDrag$Parent$demoWrapperView = F3( function (currentId, id, example) { return A2( $elm$html$Html$div, @@ -16129,7 +18045,7 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$demoWrapperView = F3( ]), _List_fromArray( [ - $author$project$ConfigGroups$OperationsOnDrag$Root$demoView(example), + $author$project$DnDListGroups$OperationsOnDrag$Parent$demoView(example), A2( $elm$html$Html$div, _List_fromArray( @@ -16143,29 +18059,29 @@ var $author$project$ConfigGroups$OperationsOnDrag$Root$demoWrapperView = F3( _Utils_eq(id, currentId)) ])), $elm$html$Html$Events$onClick( - $author$project$ConfigGroups$OperationsOnDrag$Root$LinkClicked(id)) + $author$project$DnDListGroups$OperationsOnDrag$Parent$LinkClicked(id)) ]), _List_fromArray( [ $elm$html$Html$text( - $author$project$ConfigGroups$OperationsOnDrag$Root$info(example)) + $author$project$DnDListGroups$OperationsOnDrag$Parent$info(example)) ])) ])); }); -var $author$project$ConfigGroups$OperationsOnDrag$Root$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrag$Parent$view = function (model) { return A2( $elm$html$Html$section, _List_Nil, A2( $elm$core$List$indexedMap, - $author$project$ConfigGroups$OperationsOnDrag$Root$demoWrapperView(model.at), - model.Q)); + $author$project$DnDListGroups$OperationsOnDrag$Parent$demoWrapperView(model.a7), + model.at)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$LinkClicked = function (a) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$LinkClicked = function (a) { return {$: 0, a: a}; }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -16179,27 +18095,27 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles = funct A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dragColor), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemStyles($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dragColor), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -16208,7 +18124,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$ghostView = functi return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -16217,7 +18133,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$calculateOffset = } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -16231,13 +18147,13 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$calculateOffset = } } }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'flex-grow', '1'), A2($elm$html$Html$Attributes$style, 'box-sizing', 'border-box'), @@ -16248,42 +18164,42 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyle A2($elm$html$Html$Attributes$style, 'border', '3px dashed gray'), A2($elm$html$Html$Attributes$style, 'background-color', 'transparent') ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemView = F4( function (model, offset, localIndex, _v0) { - var group = _v0.t; - var value = _v0.aB; - var color = _v0.aV; + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'insertafter-' + $elm$core$String$fromInt(globalIndex); var _v1 = _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.be(model.aa), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$maybeDragItem(model)); + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bX(model.Z), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$maybeDragItem(model)); if ((!_v1.a.$) && (!_v1.b.$)) { - var dragIndex = _v1.a.a.a9; - var dropIndex = _v1.a.a.cV; + var dragIndex = _v1.a.a.c; + var dropIndex = _v1.a.a.h; var dragItem = _v1.b.a; - return ((value === '') && (!_Utils_eq(group, dragItem.t))) ? A2( + return ((value === '') && (!_Utils_eq(group, dragItem.x))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles, - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.cU, globalIndex, itemId))), - _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.t)) ? A2( + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles, + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bM, globalIndex, itemId))), + _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.x)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles), _List_Nil) : (((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16293,8 +18209,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dropColor), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemStyles($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dropColor), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16303,7 +18219,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$dropColor)), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemStyles($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$dropColor)), _List_Nil)))); } else { return (value === '') ? A2( @@ -16311,63 +18227,63 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$auxiliaryItemStyles), _List_Nil) : A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$groupStyles, + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$itemView, + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$ResetColors), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$ResetColors), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertAfter$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertAfter$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -16381,27 +18297,27 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles = func A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dragColor), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemStyles($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dragColor), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -16410,7 +18326,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$ghostView = funct return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -16419,7 +18335,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$calculateOffset = } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -16433,13 +18349,13 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$calculateOffset = } } }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'flex-grow', '1'), A2($elm$html$Html$Attributes$style, 'box-sizing', 'border-box'), @@ -16450,42 +18366,42 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyl A2($elm$html$Html$Attributes$style, 'border', '3px dashed gray'), A2($elm$html$Html$Attributes$style, 'background-color', 'transparent') ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemView = F4( function (model, offset, localIndex, _v0) { - var group = _v0.t; - var value = _v0.aB; - var color = _v0.aV; + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'insertbefore-' + $elm$core$String$fromInt(globalIndex); var _v1 = _Utils_Tuple2( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.be(model.aa), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$maybeDragItem(model)); + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bX(model.Z), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$maybeDragItem(model)); if ((!_v1.a.$) && (!_v1.b.$)) { - var dragIndex = _v1.a.a.a9; - var dropIndex = _v1.a.a.cV; + var dragIndex = _v1.a.a.c; + var dropIndex = _v1.a.a.h; var dragItem = _v1.b.a; - return ((value === '') && (!_Utils_eq(group, dragItem.t))) ? A2( + return ((value === '') && (!_Utils_eq(group, dragItem.x))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles, - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.cU, globalIndex, itemId))), - _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.t)) ? A2( + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles, + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bM, globalIndex, itemId))), + _List_Nil) : (((value === '') && _Utils_eq(group, dragItem.x)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles), _List_Nil) : (((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16495,8 +18411,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dropColor), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemStyles($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dropColor), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16505,7 +18421,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$dropColor)), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemStyles($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$dropColor)), _List_Nil)))); } else { return (value === '') ? A2( @@ -16513,63 +18429,63 @@ var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$auxiliaryItemStyles), _List_Nil) : A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$groupStyles, + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$itemView, + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$ResetColors), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$ResetColors), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrop$InsertBefore$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrop$InsertBefore$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -16583,27 +18499,27 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles = function ( A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrop$Rotate$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrop$Rotate$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrop$Rotate$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrop$Rotate$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles($author$project$ConfigGroups$OperationsOnDrop$Rotate$dragColor), - $author$project$ConfigGroups$OperationsOnDrop$Rotate$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemStyles($author$project$DnDListGroups$OperationsOnDrop$Rotate$dragColor), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -16612,7 +18528,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$ghostView = function (m return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -16621,7 +18537,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$calculateOffset = F3( } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -16635,30 +18551,30 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$calculateOffset = F3( } } }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemView = F4( function (model, offset, localIndex, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'rotate-' + $elm$core$String$fromInt(globalIndex); - var _v1 = $author$project$ConfigGroups$OperationsOnDrop$Rotate$system.be(model.aa); + var _v1 = $author$project$DnDListGroups$OperationsOnDrop$Rotate$system.bX(model.Z); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16668,8 +18584,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles($author$project$ConfigGroups$OperationsOnDrop$Rotate$dropColor), - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemStyles($author$project$DnDListGroups$OperationsOnDrop$Rotate$dropColor), + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16678,7 +18594,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles($author$project$ConfigGroups$OperationsOnDrop$Rotate$dropColor)), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemStyles($author$project$DnDListGroups$OperationsOnDrop$Rotate$dropColor)), _List_Nil)); } else { return A2( @@ -16687,56 +18603,56 @@ var $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrop$Rotate$groupStyles, + $author$project$DnDListGroups$OperationsOnDrop$Rotate$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrop$Rotate$itemView, + $author$project$DnDListGroups$OperationsOnDrop$Rotate$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrop$Rotate$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrop$Rotate$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrop$Rotate$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrop$Rotate$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrop$Rotate$ResetColors), - $author$project$ConfigGroups$OperationsOnDrop$Rotate$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrop$Rotate$ResetColors), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrop$Rotate$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrop$Rotate$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrop$Rotate$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrop$Rotate$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$ResetColors = {$: 1}; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles = function (color) { +var $author$project$DnDListGroups$OperationsOnDrop$Swap$ResetColors = {$: 1}; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$itemStyles = function (color) { return _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'width', '50px'), @@ -16750,27 +18666,27 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles = function (co A2($elm$html$Html$Attributes$style, 'background-color', color) ]); }; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; +var $author$project$DnDListGroups$OperationsOnDrop$Swap$maybeDragItem = function (_v0) { + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$ConfigGroups$OperationsOnDrop$Swap$system.be(dnd)); + $author$project$DnDListGroups$OperationsOnDrop$Swap$system.bX(dnd)); }; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$ghostView = function (model) { - var _v0 = $author$project$ConfigGroups$OperationsOnDrop$Swap$maybeDragItem(model); +var $author$project$DnDListGroups$OperationsOnDrop$Swap$ghostView = function (model) { + var _v0 = $author$project$DnDListGroups$OperationsOnDrop$Swap$maybeDragItem(model); if (!_v0.$) { - var value = _v0.a.aB; + var value = _v0.a.aC; return A2( $elm$html$Html$div, _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles($author$project$ConfigGroups$OperationsOnDrop$Swap$dragColor), - $author$project$ConfigGroups$OperationsOnDrop$Swap$system.c$(model.aa)), + $author$project$DnDListGroups$OperationsOnDrop$Swap$itemStyles($author$project$DnDListGroups$OperationsOnDrop$Swap$dragColor), + $author$project$DnDListGroups$OperationsOnDrop$Swap$system.bS(model.Z)), _List_fromArray( [ $elm$html$Html$text(value) @@ -16779,7 +18695,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$ghostView = function (mod return $elm$html$Html$text(''); } }; -var $author$project$ConfigGroups$OperationsOnDrop$Swap$calculateOffset = F3( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$calculateOffset = F3( function (index, group, list) { calculateOffset: while (true) { @@ -16788,7 +18704,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$calculateOffset = F3( } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -16802,30 +18718,30 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$calculateOffset = F3( } } }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$groupStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$groupStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), A2($elm$html$Html$Attributes$style, 'padding-bottom', '4rem') ]); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$itemView = F4( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$itemView = F4( function (model, offset, localIndex, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'swap-' + $elm$core$String$fromInt(globalIndex); - var _v1 = $author$project$ConfigGroups$OperationsOnDrop$Swap$system.be(model.aa); + var _v1 = $author$project$DnDListGroups$OperationsOnDrop$Swap$system.bX(model.Z); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(globalIndex, dragIndex)) && (!_Utils_eq(globalIndex, dropIndex))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$Swap$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16835,8 +18751,8 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles($author$project$ConfigGroups$OperationsOnDrop$Swap$dropColor), - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$system.cU, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$Swap$itemStyles($author$project$DnDListGroups$OperationsOnDrop$Swap$dropColor), + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -16845,7 +18761,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$itemView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles($author$project$ConfigGroups$OperationsOnDrop$Swap$dropColor)), + $author$project$DnDListGroups$OperationsOnDrop$Swap$itemStyles($author$project$DnDListGroups$OperationsOnDrop$Swap$dropColor)), _List_Nil)); } else { return A2( @@ -16854,83 +18770,83 @@ var $author$project$ConfigGroups$OperationsOnDrop$Swap$itemView = F4( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( - $author$project$ConfigGroups$OperationsOnDrop$Swap$itemStyles(color), - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$system.cT, globalIndex, itemId))), + $author$project$DnDListGroups$OperationsOnDrop$Swap$itemStyles(color), + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) ])); } }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$groupView = F2( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$groupView = F2( function (model, currentGroup) { return A2( $elm$html$Html$div, - $author$project$ConfigGroups$OperationsOnDrop$Swap$groupStyles, + $author$project$DnDListGroups$OperationsOnDrop$Swap$groupStyles, A2( $elm$core$List$indexedMap, A2( - $author$project$ConfigGroups$OperationsOnDrop$Swap$itemView, + $author$project$DnDListGroups$OperationsOnDrop$Swap$itemView, model, - A3($author$project$ConfigGroups$OperationsOnDrop$Swap$calculateOffset, 0, currentGroup, model.au)), + A3($author$project$DnDListGroups$OperationsOnDrop$Swap$calculateOffset, 0, currentGroup, model.av)), A2( $elm$core$List$filter, function (_v0) { - var group = _v0.t; + var group = _v0.x; return _Utils_eq(group, currentGroup); }, - model.au))); + model.av))); }); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$sectionStyles = _List_fromArray( +var $author$project$DnDListGroups$OperationsOnDrop$Swap$sectionStyles = _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'display', 'flex'), A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), A2($elm$html$Html$Attributes$style, 'width', '800px') ]); -var $author$project$ConfigGroups$OperationsOnDrop$Swap$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrop$Swap$view = function (model) { return A2( $elm$html$Html$section, A2( $elm$core$List$cons, - $elm$html$Html$Events$onMouseDown($author$project$ConfigGroups$OperationsOnDrop$Swap$ResetColors), - $author$project$ConfigGroups$OperationsOnDrop$Swap$sectionStyles), + $elm$html$Html$Events$onMouseDown($author$project$DnDListGroups$OperationsOnDrop$Swap$ResetColors), + $author$project$DnDListGroups$OperationsOnDrop$Swap$sectionStyles), _List_fromArray( [ - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$groupView, model, 1), - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$groupView, model, 2), - A2($author$project$ConfigGroups$OperationsOnDrop$Swap$groupView, model, 3), - $author$project$ConfigGroups$OperationsOnDrop$Swap$ghostView(model) + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$groupView, model, 1), + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$groupView, model, 2), + A2($author$project$DnDListGroups$OperationsOnDrop$Swap$groupView, model, 3), + $author$project$DnDListGroups$OperationsOnDrop$Swap$ghostView(model) ])); }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$demoView = function (example) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$demoView = function (example) { switch (example.$) { case 0: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertAfterMsg, - $author$project$ConfigGroups$OperationsOnDrop$InsertAfter$view(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertAfterMsg, + $author$project$DnDListGroups$OperationsOnDrop$InsertAfter$view(mo)); case 1: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$InsertBeforeMsg, - $author$project$ConfigGroups$OperationsOnDrop$InsertBefore$view(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$InsertBeforeMsg, + $author$project$DnDListGroups$OperationsOnDrop$InsertBefore$view(mo)); case 2: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$RotateMsg, - $author$project$ConfigGroups$OperationsOnDrop$Rotate$view(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$RotateMsg, + $author$project$DnDListGroups$OperationsOnDrop$Rotate$view(mo)); default: var mo = example.a; return A2( $elm$html$Html$map, - $author$project$ConfigGroups$OperationsOnDrop$Root$SwapMsg, - $author$project$ConfigGroups$OperationsOnDrop$Swap$view(mo)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$SwapMsg, + $author$project$DnDListGroups$OperationsOnDrop$Swap$view(mo)); } }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$info = function (example) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$info = function (example) { switch (example.$) { case 0: return 'Insert after'; @@ -16942,7 +18858,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$info = function (example) return 'Swap'; } }; -var $author$project$ConfigGroups$OperationsOnDrop$Root$demoWrapperView = F3( +var $author$project$DnDListGroups$OperationsOnDrop$Parent$demoWrapperView = F3( function (currentId, id, example) { return A2( $elm$html$Html$div, @@ -16955,7 +18871,7 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$demoWrapperView = F3( ]), _List_fromArray( [ - $author$project$ConfigGroups$OperationsOnDrop$Root$demoView(example), + $author$project$DnDListGroups$OperationsOnDrop$Parent$demoView(example), A2( $elm$html$Html$div, _List_fromArray( @@ -16969,37 +18885,44 @@ var $author$project$ConfigGroups$OperationsOnDrop$Root$demoWrapperView = F3( _Utils_eq(id, currentId)) ])), $elm$html$Html$Events$onClick( - $author$project$ConfigGroups$OperationsOnDrop$Root$LinkClicked(id)) + $author$project$DnDListGroups$OperationsOnDrop$Parent$LinkClicked(id)) ]), _List_fromArray( [ $elm$html$Html$text( - $author$project$ConfigGroups$OperationsOnDrop$Root$info(example)) + $author$project$DnDListGroups$OperationsOnDrop$Parent$info(example)) ])) ])); }); -var $author$project$ConfigGroups$OperationsOnDrop$Root$view = function (model) { +var $author$project$DnDListGroups$OperationsOnDrop$Parent$view = function (model) { return A2( $elm$html$Html$section, _List_Nil, A2( $elm$core$List$indexedMap, - $author$project$ConfigGroups$OperationsOnDrop$Root$demoWrapperView(model.at), - model.Q)); + $author$project$DnDListGroups$OperationsOnDrop$Parent$demoWrapperView(model.a7), + model.at)); }; -var $author$project$ConfigGroups$Root$demoView = function (model) { - if (!model.$) { - var mo = model.a; - return A2( - $elm$html$Html$map, - $author$project$ConfigGroups$Root$OperationsOnDragMsg, - $author$project$ConfigGroups$OperationsOnDrag$Root$view(mo)); - } else { - var mo = model.a; - return A2( - $elm$html$Html$map, - $author$project$ConfigGroups$Root$OperationsOnDropMsg, - $author$project$ConfigGroups$OperationsOnDrop$Root$view(mo)); +var $author$project$DnDListGroups$Parent$demoView = function (model) { + switch (model.$) { + case 0: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDListGroups$Parent$OperationsOnDragMsg, + $author$project$DnDListGroups$OperationsOnDrag$Parent$view(mo)); + case 1: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDListGroups$Parent$OperationsOnDropMsg, + $author$project$DnDListGroups$OperationsOnDrop$Parent$view(mo)); + default: + var mo = model.a; + return A2( + $elm$html$Html$map, + $author$project$DnDListGroups$Parent$HookCommandsMsg, + $author$project$DnDListGroups$HookCommands$Parent$view(mo)); } }; var $author$project$Gallery$Hanoi$cursorStyles = _List_fromArray( @@ -17024,32 +18947,32 @@ var $author$project$Gallery$Hanoi$maybeDragDisk = F2( return A2( $elm$core$Maybe$andThen, function (_v0) { - var dragIndex = _v0.a9; + var dragIndex = _v0.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, disks)); }, - $author$project$Gallery$Hanoi$system.be(dnd)); + $author$project$Gallery$Hanoi$system.bX(dnd)); }); var $author$project$Gallery$Hanoi$paint = F3( function (solved, startColor, solvedColor) { return solved ? solvedColor : startColor; }); var $author$project$Gallery$Hanoi$ghostDiskView = function (model) { - var _v0 = A2($author$project$Gallery$Hanoi$maybeDragDisk, model.aa, model.O); + var _v0 = A2($author$project$Gallery$Hanoi$maybeDragDisk, model.Z, model.P); if (!_v0.$) { - var width = _v0.a.d4; - var startColor = _v0.a.a1; - var solvedColor = _v0.a.bn; + var width = _v0.a.aW; + var startColor = _v0.a.bb; + var solvedColor = _v0.a.bx; return A2( $elm$html$Html$div, _Utils_ap( A2( $author$project$Gallery$Hanoi$diskStyles, width, - A3($author$project$Gallery$Hanoi$paint, model.aL, startColor, solvedColor)), + A3($author$project$Gallery$Hanoi$paint, model.aP, startColor, solvedColor)), _Utils_ap( $author$project$Gallery$Hanoi$cursorStyles, - $author$project$Gallery$Hanoi$system.c$(model.aa))), + $author$project$Gallery$Hanoi$system.bS(model.Z))), _List_Nil); } else { return $elm$html$Html$text(''); @@ -17071,7 +18994,7 @@ var $author$project$Gallery$Hanoi$calculateOffset = F3( } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.aP, tower)) { + if (_Utils_eq(x.aT, tower)) { return index; } else { var $temp$index = index + 1, @@ -17097,23 +19020,23 @@ var $author$project$Gallery$Hanoi$placeholderStyles = _List_fromArray( ]); var $author$project$Gallery$Hanoi$diskView = F5( function (model, maybeTopDisk_, offset, localIndex, _v0) { - var width = _v0.d4; - var startColor = _v0.a1; - var solvedColor = _v0.bn; + var width = _v0.aW; + var startColor = _v0.bb; + var solvedColor = _v0.bx; var globalIndex = offset + localIndex; var diskId = 'id-' + $elm$core$String$fromInt(globalIndex); - var color = A3($author$project$Gallery$Hanoi$paint, model.aL, startColor, solvedColor); - var _v1 = $author$project$Gallery$Hanoi$system.be(model.aa); + var color = A3($author$project$Gallery$Hanoi$paint, model.aP, startColor, solvedColor); + var _v1 = $author$project$Gallery$Hanoi$system.bX(model.Z); if (!_v1.$) { - var dragIndex = _v1.a.a9; + var dragIndex = _v1.a.c; if (!localIndex) { var _v2 = _Utils_Tuple2( - A2($author$project$Gallery$Hanoi$maybeDragDisk, model.aa, model.O), + A2($author$project$Gallery$Hanoi$maybeDragDisk, model.Z, model.P), maybeTopDisk_); if ((!_v2.a.$) && (!_v2.b.$)) { var dragDisk = _v2.a.a; var topDisk = _v2.b.a; - return (_Utils_cmp(dragDisk.d4, topDisk.d4) < 0) ? A2( + return (_Utils_cmp(dragDisk.aW, topDisk.aW) < 0) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, @@ -17122,7 +19045,7 @@ var $author$project$Gallery$Hanoi$diskView = F5( A2($author$project$Gallery$Hanoi$diskStyles, width, color), _Utils_ap( $author$project$Gallery$Hanoi$auxiliaryStyles, - A2($author$project$Gallery$Hanoi$system.cU, globalIndex, diskId)))), + A2($author$project$Gallery$Hanoi$system.bM, globalIndex, diskId)))), _List_Nil) : A2( $elm$html$Html$div, A2( @@ -17142,7 +19065,7 @@ var $author$project$Gallery$Hanoi$diskView = F5( A2($author$project$Gallery$Hanoi$diskStyles, width, color), _Utils_ap( $author$project$Gallery$Hanoi$auxiliaryStyles, - A2($author$project$Gallery$Hanoi$system.cU, globalIndex, diskId)))), + A2($author$project$Gallery$Hanoi$system.bM, globalIndex, diskId)))), _List_Nil); } } else { @@ -17184,7 +19107,7 @@ var $author$project$Gallery$Hanoi$diskView = F5( A2($author$project$Gallery$Hanoi$diskStyles, width, color), _Utils_ap( $author$project$Gallery$Hanoi$cursorStyles, - A2($author$project$Gallery$Hanoi$system.cT, globalIndex, diskId)))), + A2($author$project$Gallery$Hanoi$system.bL, globalIndex, diskId)))), _List_Nil) : A2( $elm$html$Html$div, A2( @@ -17214,10 +19137,10 @@ var $author$project$Gallery$Hanoi$towerView = F2( var disks = A2( $elm$core$List$filter, function (_v0) { - var tower = _v0.aP; + var tower = _v0.aT; return _Utils_eq(tower, currentTower); }, - model.O); + model.P); return A2( $elm$html$Html$div, $author$project$Gallery$Hanoi$towerStyles, @@ -17227,7 +19150,7 @@ var $author$project$Gallery$Hanoi$towerView = F2( $author$project$Gallery$Hanoi$diskView, model, $author$project$Gallery$Hanoi$maybeTopDisk(disks), - A3($author$project$Gallery$Hanoi$calculateOffset, 0, currentTower, model.O)), + A3($author$project$Gallery$Hanoi$calculateOffset, 0, currentTower, model.P)), disks)); }); var $author$project$Gallery$Hanoi$view = function (model) { @@ -17269,18 +19192,18 @@ var $author$project$Gallery$Knight$ghostView = F2( var maybeDragSquare = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, squares)); }, - $author$project$Gallery$Knight$system.be(dnd)); + $author$project$Gallery$Knight$system.bX(dnd)); if (!maybeDragSquare.$) { var square = maybeDragSquare.a; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Gallery$Knight$squareStyles('transparent'), - $author$project$Gallery$Knight$system.c$(dnd)), + $author$project$Gallery$Knight$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text('♞') @@ -17338,9 +19261,9 @@ var $author$project$Gallery$Knight$squareView = F4( _List_Nil) : $elm$html$Html$text('♞'); var id = 'id-' + $elm$core$String$fromInt(index8); var color = (!(!(1 & (index8 ^ (index8 >> 3))))) ? '#d18b47' : '#ffce9e'; - var _v1 = $author$project$Gallery$Knight$system.be(dnd); + var _v1 = $author$project$Gallery$Knight$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; + var dragIndex = _v1.a.c; return ((square !== '×') && A2( $elm$core$List$member, index8, @@ -17351,7 +19274,7 @@ var $author$project$Gallery$Knight$squareView = F4( $elm$html$Html$Attributes$id(id), _Utils_ap( $author$project$Gallery$Knight$squareStyles(color), - A2($author$project$Gallery$Knight$system.cU, index5, id))), + A2($author$project$Gallery$Knight$system.bM, index5, id))), _List_fromArray( [ $elm$html$Html$text('●') @@ -17384,7 +19307,7 @@ var $author$project$Gallery$Knight$squareView = F4( $author$project$Gallery$Knight$squareStyles(color), _Utils_ap( $author$project$Gallery$Knight$cursorStyles, - A2($author$project$Gallery$Knight$system.cT, index5, id)))), + A2($author$project$Gallery$Knight$system.bL, index5, id)))), _List_fromArray( [knight])) : A2( $elm$html$Html$div, @@ -17409,9 +19332,9 @@ var $author$project$Gallery$Knight$view = function (model) { $author$project$Gallery$Knight$containerStyles, A2( $elm$core$List$indexedMap, - A2($author$project$Gallery$Knight$squareView, model.aa, model.aL), - A3($elm$core$List$map2, $elm$core$Tuple$pair, $author$project$Gallery$Knight$indices8x8, model.az))), - A2($author$project$Gallery$Knight$ghostView, model.aa, model.az) + A2($author$project$Gallery$Knight$squareView, model.Z, model.aP), + A3($elm$core$List$map2, $elm$core$Tuple$pair, $author$project$Gallery$Knight$indices8x8, model.aB))), + A2($author$project$Gallery$Knight$ghostView, model.Z, model.aB) ])); }; var $author$project$Gallery$Puzzle$containerStyles = _List_fromArray( @@ -17440,19 +19363,19 @@ var $author$project$Gallery$Puzzle$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Gallery$Puzzle$system.be(dnd)); + $author$project$Gallery$Puzzle$system.bX(dnd)); if (!maybeDragItem.$) { - var value = maybeDragItem.a.aB; - var color = maybeDragItem.a.aV; + var value = maybeDragItem.a.aC; + var color = maybeDragItem.a.a_; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Gallery$Puzzle$itemStyles(color), - $author$project$Gallery$Puzzle$system.c$(dnd)), + $author$project$Gallery$Puzzle$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -17498,14 +19421,14 @@ var $author$project$Gallery$Puzzle$dropStyles = _List_fromArray( var $author$project$Gallery$Puzzle$gray = 'dimgray'; var $author$project$Gallery$Puzzle$itemView = F4( function (dnd, offset, localIndex, _v0) { - var value = _v0.aB; - var color = _v0.aV; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'id-' + $elm$core$String$fromInt(globalIndex); - var _v1 = $author$project$Gallery$Puzzle$system.be(dnd); + var _v1 = $author$project$Gallery$Puzzle$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; - var dropIndex = _v1.a.cV; + var dragIndex = _v1.a.c; + var dropIndex = _v1.a.h; return ((!_Utils_eq(dragIndex, globalIndex)) && (!_Utils_eq(dropIndex, globalIndex))) ? A2( $elm$html$Html$div, A2( @@ -17513,7 +19436,7 @@ var $author$project$Gallery$Puzzle$itemView = F4( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Gallery$Puzzle$itemStyles(color), - A2($author$project$Gallery$Puzzle$system.cU, globalIndex, itemId))), + A2($author$project$Gallery$Puzzle$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -17526,7 +19449,7 @@ var $author$project$Gallery$Puzzle$itemView = F4( $author$project$Gallery$Puzzle$itemStyles(color), _Utils_ap( $author$project$Gallery$Puzzle$dropStyles, - A2($author$project$Gallery$Puzzle$system.cU, globalIndex, itemId)))), + A2($author$project$Gallery$Puzzle$system.bM, globalIndex, itemId)))), _List_fromArray( [ $elm$html$Html$text(value) @@ -17545,7 +19468,7 @@ var $author$project$Gallery$Puzzle$itemView = F4( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Gallery$Puzzle$itemStyles(color), - A2($author$project$Gallery$Puzzle$system.cT, globalIndex, itemId))), + A2($author$project$Gallery$Puzzle$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -17584,16 +19507,16 @@ var $author$project$Gallery$Puzzle$view = function (model) { function (i) { return A4( $author$project$Gallery$Puzzle$groupView, - model.aa, + model.Z, A2( $elm$core$List$take, 4, - A2($elm$core$List$drop, i * 4, model.au)), + A2($elm$core$List$drop, i * 4, model.av)), i * 4, i); }, A2($elm$core$List$range, 0, 3))), - A2($author$project$Gallery$Puzzle$ghostView, model.aa, model.au) + A2($author$project$Gallery$Puzzle$ghostView, model.Z, model.av) ])); }; var $author$project$Gallery$Shapes$containerStyles = _List_fromArray( @@ -17722,19 +19645,19 @@ var $author$project$Gallery$Shapes$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Gallery$Shapes$system.be(dnd)); + $author$project$Gallery$Shapes$system.bX(dnd)); if (!maybeDragItem.$) { - var shape = maybeDragItem.a.ax; - var color = maybeDragItem.a.aV; + var shape = maybeDragItem.a.ay; + var color = maybeDragItem.a.a_; return A3( $author$project$Gallery$Shapes$svgView, shape, color, - $author$project$Gallery$Shapes$system.c$(dnd)); + $author$project$Gallery$Shapes$system.bS(dnd)); } else { return $elm$html$Html$text(''); } @@ -17750,11 +19673,11 @@ var $author$project$Gallery$Shapes$wrapperStyles = _List_fromArray( ]); var $author$project$Gallery$Shapes$holeView = F3( function (dnd, index, _v0) { - var shape = _v0.ax; - var color = _v0.aV; + var shape = _v0.ay; + var color = _v0.a_; var globalIndex = $author$project$Gallery$Shapes$shapeNumber + index; var itemId = 'hole-' + $elm$core$String$fromInt(globalIndex); - var _v1 = $author$project$Gallery$Shapes$system.be(dnd); + var _v1 = $author$project$Gallery$Shapes$system.bX(dnd); if (!_v1.$) { return A2( $elm$html$Html$div, @@ -17768,7 +19691,7 @@ var $author$project$Gallery$Shapes$holeView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - A2($author$project$Gallery$Shapes$system.cU, globalIndex, itemId))) + A2($author$project$Gallery$Shapes$system.bM, globalIndex, itemId))) ])); } else { return A2( @@ -17794,7 +19717,7 @@ var $author$project$Gallery$Shapes$scoreView = function (items) { A2( $elm$core$Basics$composeR, function ($) { - return $.am; + return $.al; }, $elm$core$Basics$add), 0, @@ -17813,13 +19736,13 @@ var $author$project$Gallery$Shapes$scoreView = function (items) { }; var $author$project$Gallery$Shapes$shapeView = F3( function (dnd, index, _v0) { - var shape = _v0.ax; - var color = _v0.aV; - var solved = _v0.aL; + var shape = _v0.ay; + var color = _v0.a_; + var solved = _v0.aP; var itemId = 'shape-' + $elm$core$String$fromInt(index); - var _v1 = $author$project$Gallery$Shapes$system.be(dnd); + var _v1 = $author$project$Gallery$Shapes$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; + var dragIndex = _v1.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, $author$project$Gallery$Shapes$wrapperStyles, @@ -17847,7 +19770,7 @@ var $author$project$Gallery$Shapes$shapeView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - A2($author$project$Gallery$Shapes$system.cT, index, itemId))) + A2($author$project$Gallery$Shapes$system.bL, index, itemId))) ])); } }); @@ -17857,22 +19780,22 @@ var $author$project$Gallery$Shapes$view = function (model) { _List_Nil, _List_fromArray( [ - $author$project$Gallery$Shapes$scoreView(model.au), + $author$project$Gallery$Shapes$scoreView(model.av), A2( $elm$html$Html$div, $author$project$Gallery$Shapes$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Gallery$Shapes$shapeView(model.aa), - A2($elm$core$List$take, $author$project$Gallery$Shapes$shapeNumber, model.au))), + $author$project$Gallery$Shapes$shapeView(model.Z), + A2($elm$core$List$take, $author$project$Gallery$Shapes$shapeNumber, model.av))), A2( $elm$html$Html$div, $author$project$Gallery$Shapes$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Gallery$Shapes$holeView(model.aa), - A2($elm$core$List$drop, $author$project$Gallery$Shapes$shapeNumber, model.au))), - A2($author$project$Gallery$Shapes$ghostView, model.aa, model.au) + $author$project$Gallery$Shapes$holeView(model.Z), + A2($elm$core$List$drop, $author$project$Gallery$Shapes$shapeNumber, model.av))), + A2($author$project$Gallery$Shapes$ghostView, model.Z, model.av) ])); }; var $author$project$Gallery$TaskBoard$boardStyles = _List_fromArray( @@ -17904,28 +19827,28 @@ var $author$project$Gallery$TaskBoard$cursorStyles = _List_fromArray( ]); var $author$project$Gallery$TaskBoard$maybeDragCard = function (_v0) { var cardDnD = _v0.K; - var cards = _v0.C; + var cards = _v0.D; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, cards)); }, - $author$project$Gallery$TaskBoard$cardSystem.be(cardDnD)); + $author$project$Gallery$TaskBoard$cardSystem.bX(cardDnD)); }; var $author$project$Gallery$TaskBoard$yellow = '#ffdf76'; var $author$project$Gallery$TaskBoard$cardGhostView = function (model) { var _v0 = $author$project$Gallery$TaskBoard$maybeDragCard(model); if (!_v0.$) { - var description = _v0.a.aG; + var description = _v0.a.ap; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Gallery$TaskBoard$cardStyles($author$project$Gallery$TaskBoard$yellow), _Utils_ap( $author$project$Gallery$TaskBoard$cursorStyles, - $author$project$Gallery$TaskBoard$cardSystem.c$(model.K))), + $author$project$Gallery$TaskBoard$cardSystem.bS(model.K))), _List_fromArray( [ $elm$html$Html$text(description) @@ -17973,7 +19896,7 @@ var $author$project$Gallery$TaskBoard$auxiliaryCardStyles = _List_fromArray( A2($elm$html$Html$Attributes$style, 'min-height', '60px') ]); var $author$project$Gallery$TaskBoard$eventlessCardView = function (_v0) { - var description = _v0.aG; + var description = _v0.ap; return (description === '') ? A2($elm$html$Html$div, $author$project$Gallery$TaskBoard$auxiliaryCardStyles, _List_Nil) : A2( $elm$html$Html$div, $author$project$Gallery$TaskBoard$cardStyles($author$project$Gallery$TaskBoard$yellow), @@ -17984,7 +19907,7 @@ var $author$project$Gallery$TaskBoard$eventlessCardView = function (_v0) { }; var $author$project$Gallery$TaskBoard$Heading = F2( function (title, color) { - return {aV: color, aA: title}; + return {a_: color, ai: title}; }); var $author$project$Gallery$TaskBoard$blue = '#055b8f'; var $author$project$Gallery$TaskBoard$green = '#5b8f05'; @@ -17994,7 +19917,7 @@ var $author$project$Gallery$TaskBoard$getActivity = function (cards) { return A2($author$project$Gallery$TaskBoard$Heading, '', ''); } else { var card = cards.a; - var _v1 = card.r; + var _v1 = card.t; switch (_v1) { case 0: return A2($author$project$Gallery$TaskBoard$Heading, 'To Do', $author$project$Gallery$TaskBoard$blue); @@ -18008,18 +19931,18 @@ var $author$project$Gallery$TaskBoard$getActivity = function (cards) { var $elm$html$Html$h3 = _VirtualDom_node('h3'); var $author$project$Gallery$TaskBoard$maybeDragColumn = function (_v0) { var columnDnD = _v0.M; - var cards = _v0.C; + var cards = _v0.D; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2( $elm$core$List$drop, dragIndex, $author$project$Gallery$TaskBoard$gatherByActivity(cards))); }, - $author$project$Gallery$TaskBoard$columnSystem.be(columnDnD)); + $author$project$Gallery$TaskBoard$columnSystem.bX(columnDnD)); }; var $author$project$Gallery$TaskBoard$columnGhostView = function (model) { var _v0 = $author$project$Gallery$TaskBoard$maybeDragColumn(model); @@ -18031,15 +19954,15 @@ var $author$project$Gallery$TaskBoard$columnGhostView = function (model) { $elm$html$Html$div, _Utils_ap( $author$project$Gallery$TaskBoard$columnStyles('transparent'), - $author$project$Gallery$TaskBoard$columnSystem.c$(model.M)), + $author$project$Gallery$TaskBoard$columnSystem.bS(model.M)), _List_fromArray( [ A2( $elm$html$Html$h3, - $author$project$Gallery$TaskBoard$columnHeadingStyles(heading.aV), + $author$project$Gallery$TaskBoard$columnHeadingStyles(heading.a_), _List_fromArray( [ - $elm$html$Html$text(heading.aA) + $elm$html$Html$text(heading.ai) ])), A2( $elm$html$Html$div, @@ -18053,25 +19976,25 @@ var $author$project$Gallery$TaskBoard$columnGhostView = function (model) { var $author$project$Gallery$TaskBoard$gray = '#a5a5a5'; var $author$project$Gallery$TaskBoard$eventfulCardView = F4( function (model, offset, localIndex, _v0) { - var activity = _v0.r; - var description = _v0.aG; + var activity = _v0.t; + var description = _v0.ap; var globalIndex = offset + localIndex; var cardId = 'card-' + $elm$core$String$fromInt(globalIndex); var _v1 = _Utils_Tuple2( - $author$project$Gallery$TaskBoard$cardSystem.be(model.K), + $author$project$Gallery$TaskBoard$cardSystem.bX(model.K), $author$project$Gallery$TaskBoard$maybeDragCard(model)); if ((!_v1.a.$) && (!_v1.b.$)) { - var dragIndex = _v1.a.a.a9; + var dragIndex = _v1.a.a.c; var dragCard = _v1.b.a; - return ((description === '') && (!_Utils_eq(activity, dragCard.r))) ? A2( + return ((description === '') && (!_Utils_eq(activity, dragCard.t))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(cardId), _Utils_ap( $author$project$Gallery$TaskBoard$auxiliaryCardStyles, - A2($author$project$Gallery$TaskBoard$cardSystem.cU, globalIndex, cardId))), - _List_Nil) : (((description === '') && _Utils_eq(activity, dragCard.r)) ? A2( + A2($author$project$Gallery$TaskBoard$cardSystem.bM, globalIndex, cardId))), + _List_Nil) : (((description === '') && _Utils_eq(activity, dragCard.t)) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, @@ -18084,7 +20007,7 @@ var $author$project$Gallery$TaskBoard$eventfulCardView = F4( $elm$html$Html$Attributes$id(cardId), _Utils_ap( $author$project$Gallery$TaskBoard$cardStyles($author$project$Gallery$TaskBoard$yellow), - A2($author$project$Gallery$TaskBoard$cardSystem.cU, globalIndex, cardId))), + A2($author$project$Gallery$TaskBoard$cardSystem.bM, globalIndex, cardId))), _List_fromArray( [ $elm$html$Html$text(description) @@ -18111,7 +20034,7 @@ var $author$project$Gallery$TaskBoard$eventfulCardView = F4( $author$project$Gallery$TaskBoard$cardStyles($author$project$Gallery$TaskBoard$yellow), _Utils_ap( $author$project$Gallery$TaskBoard$cursorStyles, - A2($author$project$Gallery$TaskBoard$cardSystem.cT, globalIndex, cardId)))), + A2($author$project$Gallery$TaskBoard$cardSystem.bL, globalIndex, cardId)))), _List_fromArray( [ $elm$html$Html$text(description) @@ -18123,10 +20046,10 @@ var $author$project$Gallery$TaskBoard$columnView = F4( var heading = $author$project$Gallery$TaskBoard$getActivity( A2($elm$core$List$take, 1, cards)); var columnId = 'column-' + $elm$core$String$fromInt(index); - var _v0 = $author$project$Gallery$TaskBoard$columnSystem.be(model.M); + var _v0 = $author$project$Gallery$TaskBoard$columnSystem.bX(model.M); if (!_v0.$) { - var dragIndex = _v0.a.a9; - var dragElement = _v0.a.P; + var dragIndex = _v0.a.c; + var dragElement = _v0.a.Q; if (!_Utils_eq(dragIndex, index)) { return A2( $elm$html$Html$div, @@ -18135,15 +20058,15 @@ var $author$project$Gallery$TaskBoard$columnView = F4( $elm$html$Html$Attributes$id(columnId), _Utils_ap( $author$project$Gallery$TaskBoard$columnStyles('transparent'), - A2($author$project$Gallery$TaskBoard$columnSystem.cU, index, columnId))), + A2($author$project$Gallery$TaskBoard$columnSystem.bM, index, columnId))), _List_fromArray( [ A2( $elm$html$Html$h3, - $author$project$Gallery$TaskBoard$columnHeadingStyles(heading.aV), + $author$project$Gallery$TaskBoard$columnHeadingStyles(heading.a_), _List_fromArray( [ - $elm$html$Html$text(heading.aA) + $elm$html$Html$text(heading.ai) ])), A2( $elm$html$Html$div, @@ -18152,7 +20075,7 @@ var $author$project$Gallery$TaskBoard$columnView = F4( ])); } else { var height = $elm$core$String$fromInt( - $elm$core$Basics$round(dragElement.cW.c2)); + $elm$core$Basics$round(dragElement.c5.db)); return A2( $elm$html$Html$div, A2( @@ -18178,11 +20101,11 @@ var $author$project$Gallery$TaskBoard$columnView = F4( A2( $elm$html$Html$h3, _Utils_ap( - $author$project$Gallery$TaskBoard$columnHeadingStyles(heading.aV), - A2($author$project$Gallery$TaskBoard$columnSystem.cT, index, columnId)), + $author$project$Gallery$TaskBoard$columnHeadingStyles(heading.a_), + A2($author$project$Gallery$TaskBoard$columnSystem.bL, index, columnId)), _List_fromArray( [ - $elm$html$Html$text(heading.aA) + $elm$html$Html$text(heading.ai) ])), A2( $elm$html$Html$div, @@ -18195,7 +20118,7 @@ var $author$project$Gallery$TaskBoard$columnView = F4( } }); var $author$project$Gallery$TaskBoard$view = function (model) { - var columns = $author$project$Gallery$TaskBoard$gatherByActivity(model.C); + var columns = $author$project$Gallery$TaskBoard$gatherByActivity(model.D); var calculateOffset = function (columnIndex) { return A3( $elm$core$List$foldl, @@ -18257,10 +20180,10 @@ var $author$project$Gallery$TryOn$colorStyles = F3( }); var $author$project$Gallery$TryOn$colorView = F3( function (model, index, item) { - var width = item.aJ * 4; + var width = item.aO * 4; var id = 'color-' + $elm$core$String$fromInt(index); - var height = item.aJ * 4; - var _v0 = $author$project$Gallery$TryOn$system.be(model.aa); + var height = item.aO * 4; + var _v0 = $author$project$Gallery$TryOn$system.bX(model.Z); if (!_v0.$) { return A2( $elm$html$Html$div, @@ -18268,7 +20191,7 @@ var $author$project$Gallery$TryOn$colorView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(id), _Utils_ap( - A3($author$project$Gallery$TryOn$colorStyles, width, height, item.aV), + A3($author$project$Gallery$TryOn$colorStyles, width, height, item.a_), _List_fromArray( [ A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') @@ -18281,25 +20204,25 @@ var $author$project$Gallery$TryOn$colorView = F3( $elm$core$List$cons, $elm$html$Html$Attributes$id(id), _Utils_ap( - A3($author$project$Gallery$TryOn$colorStyles, width, height, item.aV), + A3($author$project$Gallery$TryOn$colorStyles, width, height, item.a_), A2( $elm$core$List$cons, A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - A2($author$project$Gallery$TryOn$system.cT, index, id)))), + A2($author$project$Gallery$TryOn$system.bL, index, id)))), _List_Nil); } }); var $author$project$Gallery$TryOn$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var items = _v0.au; + var dnd = _v0.Z; + var items = _v0.av; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Gallery$TryOn$system.be(dnd)); + $author$project$Gallery$TryOn$system.bX(dnd)); }; var $elm$svg$Svg$Attributes$d = _VirtualDom_attribute('d'); var $elm$svg$Svg$path = $elm$svg$Svg$trustedNode('path'); @@ -18346,21 +20269,21 @@ var $author$project$Gallery$TryOn$svgView = F4( }); var $author$project$Gallery$TryOn$ghostView = function (model) { var _v0 = _Utils_Tuple2( - $author$project$Gallery$TryOn$system.be(model.aa), + $author$project$Gallery$TryOn$system.bX(model.Z), $author$project$Gallery$TryOn$maybeDragItem(model)); if ((!_v0.a.$) && (!_v0.b.$)) { - var dropElement = _v0.a.a.ab; - var color = _v0.b.a.aV; + var dropElement = _v0.a.a._; + var color = _v0.b.a.a_; var baseFontSize = 14; - var height = $elm$core$Basics$round(dropElement.cW.c2 / baseFontSize); - var width = $elm$core$Basics$round(dropElement.cW.d4 / baseFontSize); + var height = $elm$core$Basics$round(dropElement.c5.db / baseFontSize); + var width = $elm$core$Basics$round(dropElement.c5.aW / baseFontSize); return A4( $author$project$Gallery$TryOn$svgView, width, height, color, _Utils_ap( - $author$project$Gallery$TryOn$system.c$(model.aa), + $author$project$Gallery$TryOn$system.bS(model.Z), _List_fromArray( [ A2( @@ -18400,13 +20323,13 @@ var $author$project$Gallery$TryOn$wrapperStyles = _List_fromArray( ]); var $author$project$Gallery$TryOn$sizeView = F4( function (model, offset, localIndex, item) { - var width = item.aJ * 50; + var width = item.aO * 50; var id = 'size-' + $elm$core$String$fromInt(localIndex); - var height = item.aJ * 50; + var height = item.aO * 50; var globalIndex = offset + localIndex; - var _v0 = $author$project$Gallery$TryOn$system.be(model.aa); + var _v0 = $author$project$Gallery$TryOn$system.bX(model.Z); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, globalIndex)) ? A2( $elm$html$Html$div, $author$project$Gallery$TryOn$wrapperStyles, @@ -18416,11 +20339,11 @@ var $author$project$Gallery$TryOn$sizeView = F4( $author$project$Gallery$TryOn$svgView, width, height, - item.aV, + item.a_, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(id), - A2($author$project$Gallery$TryOn$system.cU, globalIndex, id))) + A2($author$project$Gallery$TryOn$system.bM, globalIndex, id))) ])) : A2( $elm$html$Html$div, $author$project$Gallery$TryOn$wrapperStyles, @@ -18434,10 +20357,10 @@ var $author$project$Gallery$TryOn$sizeView = F4( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(id), - A2($author$project$Gallery$TryOn$system.cU, globalIndex, id))) + A2($author$project$Gallery$TryOn$system.bM, globalIndex, id))) ])); } else { - return (item.aV !== 'dimgray') ? A2( + return (item.a_ !== 'dimgray') ? A2( $elm$html$Html$div, $author$project$Gallery$TryOn$wrapperStyles, _List_fromArray( @@ -18446,14 +20369,14 @@ var $author$project$Gallery$TryOn$sizeView = F4( $author$project$Gallery$TryOn$svgView, width, height, - item.aV, + item.a_, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(id), A2( $elm$core$List$cons, A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - A2($author$project$Gallery$TryOn$system.cT, globalIndex, id)))) + A2($author$project$Gallery$TryOn$system.bL, globalIndex, id)))) ])) : A2( $elm$html$Html$div, $author$project$Gallery$TryOn$wrapperStyles, @@ -18463,7 +20386,7 @@ var $author$project$Gallery$TryOn$sizeView = F4( $author$project$Gallery$TryOn$svgView, width, height, - item.aV, + item.a_, _List_fromArray( [ $elm$html$Html$Attributes$id(id) @@ -18486,9 +20409,9 @@ var $author$project$Gallery$TryOn$view = function (model) { A2( $elm$core$List$filter, function (item) { - return !item.aI; + return !item.aN; }, - model.au))), + model.av))), A2( $elm$html$Html$div, $author$project$Gallery$TryOn$sizeGroupStyles, @@ -18501,55 +20424,55 @@ var $author$project$Gallery$TryOn$view = function (model) { A2( $elm$core$List$filter, function (item) { - return !item.aI; + return !item.aN; }, - model.au))), + model.av))), A2( $elm$core$List$filter, function (item) { - return item.aI === 1; + return item.aN === 1; }, - model.au))), + model.av))), $author$project$Gallery$TryOn$ghostView(model) ])); }; -var $author$project$Gallery$Root$demoView = function (model) { +var $author$project$Gallery$Parent$demoView = function (model) { switch (model.$) { case 0: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Gallery$Root$HanoiMsg, + $author$project$Gallery$Parent$HanoiMsg, $author$project$Gallery$Hanoi$view(mo)); case 1: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Gallery$Root$PuzzleMsg, + $author$project$Gallery$Parent$PuzzleMsg, $author$project$Gallery$Puzzle$view(mo)); case 2: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Gallery$Root$ShapesMsg, + $author$project$Gallery$Parent$ShapesMsg, $author$project$Gallery$Shapes$view(mo)); case 3: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Gallery$Root$KnightMsg, + $author$project$Gallery$Parent$KnightMsg, $author$project$Gallery$Knight$view(mo)); case 4: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Gallery$Root$TryOnMsg, + $author$project$Gallery$Parent$TryOnMsg, $author$project$Gallery$TryOn$view(mo)); default: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Gallery$Root$TaskBoardMsg, + $author$project$Gallery$Parent$TaskBoardMsg, $author$project$Gallery$TaskBoard$view(mo)); } }; @@ -18558,16 +20481,16 @@ var $author$project$Introduction$Basic$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Basic$system.be(dnd)); + $author$project$Introduction$Basic$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, - $author$project$Introduction$Basic$system.c$(dnd), + $author$project$Introduction$Basic$system.bS(dnd), _List_fromArray( [ $elm$html$Html$text(item) @@ -18579,15 +20502,15 @@ var $author$project$Introduction$Basic$ghostView = F2( var $author$project$Introduction$Basic$itemView = F3( function (dnd, index, item) { var itemId = 'id-' + item; - var _v0 = $author$project$Introduction$Basic$system.be(dnd); + var _v0 = $author$project$Introduction$Basic$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$p, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - A2($author$project$Introduction$Basic$system.cU, index, itemId)), + A2($author$project$Introduction$Basic$system.bM, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) @@ -18607,7 +20530,7 @@ var $author$project$Introduction$Basic$itemView = F3( A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), - A2($author$project$Introduction$Basic$system.cT, index, itemId)), + A2($author$project$Introduction$Basic$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text(item) @@ -18628,9 +20551,9 @@ var $author$project$Introduction$Basic$view = function (model) { _List_Nil, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Basic$itemView(model.aa), - model.au)), - A2($author$project$Introduction$Basic$ghostView, model.aa, model.au) + $author$project$Introduction$Basic$itemView(model.Z), + model.av)), + A2($author$project$Introduction$Basic$ghostView, model.Z, model.av) ])); }; var $mdgriffith$elm_ui$Internal$Model$AlignX = function (a) { @@ -18648,16 +20571,16 @@ var $mdgriffith$elm_ui$Internal$Model$Unkeyed = function (a) { }; var $mdgriffith$elm_ui$Internal$Model$AsColumn = 1; var $mdgriffith$elm_ui$Internal$Model$asColumn = 1; -var $mdgriffith$elm_ui$Internal$Style$classes = {cg: 'a', a4: 'atv', ci: 'ab', cj: 'cx', ck: 'cy', cl: 'acb', cm: 'accx', cn: 'accy', co: 'acr', bu: 'al', bv: 'ar', cp: 'at', a5: 'ah', a6: 'av', cr: 's', cw: 'bh', cx: 'b', cz: 'w7', cB: 'bd', cC: 'bdt', aS: 'bn', cD: 'bs', aT: 'cpe', cI: 'cp', cJ: 'cpx', cK: 'cpy', L: 'c', aW: 'ctr', aX: 'cb', aY: 'ccx', N: 'ccy', aF: 'cl', aZ: 'cr', cO: 'ct', cP: 'cptr', cQ: 'ctxt', cZ: 'fcs', bD: 'focus-within', c_: 'fs', c0: 'g', bb: 'hbh', bc: 'hc', bG: 'he', bd: 'hf', bH: 'hfp', c4: 'hv', c6: 'ic', c8: 'fr', da: 'iml', db: 'imlf', dc: 'imlp', dd: 'implw', de: 'it', df: 'i', bM: 'lnk', av: 'nb', bP: 'notxt', dm: 'ol', $7: 'or', ag: 'oq', dt: 'oh', bT: 'pg', bU: 'p', du: 'ppe', dw: 'ui', A: 'r', dy: 'sb', dz: 'sbx', dA: 'sby', dB: 'sbt', dE: 'e', dF: 'cap', dG: 'sev', dM: 'sk', q: 't', dO: 'tc', dP: 'w8', dQ: 'w2', dR: 'w9', dS: 'tj', a2: 'tja', dT: 'tl', dU: 'w3', dV: 'w5', dW: 'w4', dX: 'tr', dY: 'w6', dZ: 'w1', d_: 'tun', b8: 'ts', ak: 'clr', d2: 'u', bq: 'wc', cd: 'we', br: 'wf', ce: 'wfp', bs: 'wrp'}; +var $mdgriffith$elm_ui$Internal$Style$classes = {cx: 'a', bf: 'atv', cz: 'ab', cA: 'cx', cB: 'cy', cC: 'acb', cD: 'accx', cE: 'accy', cF: 'acr', bE: 'al', bF: 'ar', cG: 'at', bg: 'ah', bh: 'av', cI: 's', cM: 'bh', cN: 'b', cP: 'w7', cR: 'bd', cS: 'bdt', aX: 'bn', cT: 'bs', aY: 'cpe', cY: 'cp', cZ: 'cpx', c_: 'cpy', L: 'c', a0: 'ctr', a1: 'cb', a2: 'ccx', N: 'ccy', aI: 'cl', a3: 'cr', c0: 'ct', c1: 'cptr', c2: 'ctxt', c8: 'fcs', bP: 'focus-within', c9: 'fs', da: 'g', bl: 'hbh', bm: 'hc', bT: 'he', bn: 'hf', bU: 'hfp', dd: 'hv', df: 'ic', dh: 'fr', dj: 'iml', dk: 'imlf', dl: 'imlp', dm: 'implw', dn: 'it', $7: 'i', b_: 'lnk', aw: 'nb', b3: 'notxt', ds: 'ol', du: 'or', ad: 'oq', dy: 'oh', b7: 'pg', b8: 'p', dz: 'ppe', dB: 'ui', B: 'r', dD: 'sb', dE: 'sbx', dF: 'sby', dG: 'sbt', dI: 'e', dJ: 'cap', dK: 'sev', dQ: 'sk', s: 't', dS: 'tc', dT: 'w8', dU: 'w2', dV: 'w9', dW: 'tj', bc: 'tja', dX: 'tl', dY: 'w3', dZ: 'w5', d_: 'w4', d$: 'tr', d0: 'w6', d1: 'w1', d2: 'tun', cp: 'ts', aj: 'clr', d6: 'u', bA: 'wc', cu: 'we', bB: 'wf', cv: 'wfp', bC: 'wrp'}; var $mdgriffith$elm_ui$Internal$Model$Generic = {$: 0}; var $mdgriffith$elm_ui$Internal$Model$div = $mdgriffith$elm_ui$Internal$Model$Generic; var $mdgriffith$elm_ui$Internal$Model$NoNearbyChildren = {$: 0}; -var $mdgriffith$elm_ui$Internal$Model$columnClass = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.L); -var $mdgriffith$elm_ui$Internal$Model$gridClass = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.c0); -var $mdgriffith$elm_ui$Internal$Model$pageClass = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bT); -var $mdgriffith$elm_ui$Internal$Model$paragraphClass = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bU); -var $mdgriffith$elm_ui$Internal$Model$rowClass = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.A); -var $mdgriffith$elm_ui$Internal$Model$singleClass = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.dE); +var $mdgriffith$elm_ui$Internal$Model$columnClass = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.L); +var $mdgriffith$elm_ui$Internal$Model$gridClass = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.da); +var $mdgriffith$elm_ui$Internal$Model$pageClass = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.b7); +var $mdgriffith$elm_ui$Internal$Model$paragraphClass = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.b8); +var $mdgriffith$elm_ui$Internal$Model$rowClass = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.B); +var $mdgriffith$elm_ui$Internal$Model$singleClass = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.dI); var $mdgriffith$elm_ui$Internal$Model$contextClasses = function (context) { switch (context) { case 0: @@ -18821,15 +20744,6 @@ var $mdgriffith$elm_ui$Internal$Model$transformClass = function (transform) { 'tfrm-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(tx) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(ty) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(tz) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(sx) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(sy) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(sz) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(ox) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(oy) + ('-' + ($mdgriffith$elm_ui$Internal$Model$floatClass(oz) + ('-' + $mdgriffith$elm_ui$Internal$Model$floatClass(angle)))))))))))))))))))); } }; -var $elm$core$Maybe$withDefault = F2( - function (_default, maybe) { - if (!maybe.$) { - var value = maybe.a; - return value; - } else { - return _default; - } - }); var $mdgriffith$elm_ui$Internal$Model$getStyleName = function (style) { switch (style.$) { case 13: @@ -18878,13 +20792,13 @@ var $mdgriffith$elm_ui$Internal$Model$getStyleName = function (style) { return 'grid-rows-' + (A2( $elm$core$String$join, '-', - A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.dx)) + ('-cols-' + (A2( + A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.dC)) + ('-cols-' + (A2( $elm$core$String$join, '-', - A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.D)) + ('-space-x-' + ($mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dH.a) + ('-space-y-' + $mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dH.b))))))); + A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.E)) + ('-space-x-' + ($mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dL.a) + ('-space-y-' + $mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dL.b))))))); case 9: var pos = style.a; - return 'gp grid-pos-' + ($elm$core$String$fromInt(pos.A) + ('-' + ($elm$core$String$fromInt(pos.cL) + ('-' + ($elm$core$String$fromInt(pos.d4) + ('-' + $elm$core$String$fromInt(pos.c2))))))); + return 'gp grid-pos-' + ($elm$core$String$fromInt(pos.B) + ('-' + ($elm$core$String$fromInt(pos.c$) + ('-' + ($elm$core$String$fromInt(pos.aW) + ('-' + $elm$core$String$fromInt(pos.db))))))); case 11: var selector = style.a; var subStyle = style.b; @@ -18980,17 +20894,17 @@ var $mdgriffith$elm_ui$Internal$Model$formatBoxShadow = function (shadow) { $elm$core$Basics$identity, _List_fromArray( [ - shadow.bK ? $elm$core$Maybe$Just('inset') : $elm$core$Maybe$Nothing, + shadow.bY ? $elm$core$Maybe$Just('inset') : $elm$core$Maybe$Nothing, $elm$core$Maybe$Just( - $elm$core$String$fromFloat(shadow.bQ.a) + 'px'), + $elm$core$String$fromFloat(shadow.b4.a) + 'px'), $elm$core$Maybe$Just( - $elm$core$String$fromFloat(shadow.bQ.b) + 'px'), + $elm$core$String$fromFloat(shadow.b4.b) + 'px'), $elm$core$Maybe$Just( - $elm$core$String$fromFloat(shadow.ao) + 'px'), + $elm$core$String$fromFloat(shadow.an) + 'px'), $elm$core$Maybe$Just( - $elm$core$String$fromFloat(shadow.aJ) + 'px'), + $elm$core$String$fromFloat(shadow.aO) + 'px'), $elm$core$Maybe$Just( - $mdgriffith$elm_ui$Internal$Model$formatColor(shadow.aV)) + $mdgriffith$elm_ui$Internal$Model$formatColor(shadow.a_)) ]))); }; var $elm$core$Tuple$mapFirst = F2( @@ -19014,7 +20928,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { [ A2( $mdgriffith$elm_ui$Internal$Model$Style, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bD) + ':focus-within', + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bP) + ':focus-within', A2( $elm$core$List$filterMap, $elm$core$Basics$identity, @@ -19028,7 +20942,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { 'border-color', $mdgriffith$elm_ui$Internal$Model$formatColor(color)); }, - focus.cA), + focus.cQ), A2( $elm$core$Maybe$map, function (color) { @@ -19037,7 +20951,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { 'background-color', $mdgriffith$elm_ui$Internal$Model$formatColor(color)); }, - focus.ct), + focus.cK), A2( $elm$core$Maybe$map, function (shadow) { @@ -19046,23 +20960,23 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { 'box-shadow', $mdgriffith$elm_ui$Internal$Model$formatBoxShadow( { - ao: shadow.ao, - aV: shadow.aV, - bK: false, - bQ: A2( + an: shadow.an, + a_: shadow.a_, + bY: false, + b4: A2( $elm$core$Tuple$mapSecond, $elm$core$Basics$toFloat, - A2($elm$core$Tuple$mapFirst, $elm$core$Basics$toFloat, shadow.bQ)), - aJ: shadow.aJ + A2($elm$core$Tuple$mapFirst, $elm$core$Basics$toFloat, shadow.b4)), + aO: shadow.aO })); }, - focus.dD), + focus.dH), $elm$core$Maybe$Just( A2($mdgriffith$elm_ui$Internal$Model$Property, 'outline', 'none')) ]))), A2( $mdgriffith$elm_ui$Internal$Model$Style, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + (':focus .focusable, ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + '.focusable:focus')), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + (':focus .focusable, ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + '.focusable:focus')), A2( $elm$core$List$filterMap, $elm$core$Basics$identity, @@ -19076,7 +20990,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { 'border-color', $mdgriffith$elm_ui$Internal$Model$formatColor(color)); }, - focus.cA), + focus.cQ), A2( $elm$core$Maybe$map, function (color) { @@ -19085,7 +20999,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { 'background-color', $mdgriffith$elm_ui$Internal$Model$formatColor(color)); }, - focus.ct), + focus.cK), A2( $elm$core$Maybe$map, function (shadow) { @@ -19094,17 +21008,17 @@ var $mdgriffith$elm_ui$Internal$Model$renderFocusStyle = function (focus) { 'box-shadow', $mdgriffith$elm_ui$Internal$Model$formatBoxShadow( { - ao: shadow.ao, - aV: shadow.aV, - bK: false, - bQ: A2( + an: shadow.an, + a_: shadow.a_, + bY: false, + b4: A2( $elm$core$Tuple$mapSecond, $elm$core$Basics$toFloat, - A2($elm$core$Tuple$mapFirst, $elm$core$Basics$toFloat, shadow.bQ)), - aJ: shadow.aJ + A2($elm$core$Tuple$mapFirst, $elm$core$Basics$toFloat, shadow.b4)), + aO: shadow.aO })); }, - focus.dD), + focus.dH), $elm$core$Maybe$Just( A2($mdgriffith$elm_ui$Internal$Model$Property, 'outline', 'none')) ]))) @@ -19147,19 +21061,19 @@ var $mdgriffith$elm_ui$Internal$Style$contentName = function (desc) { switch (desc) { case 0: var _v1 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cO); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c0); case 1: var _v2 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aX); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a1); case 2: var _v3 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aZ); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a3); case 3: var _v4 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aF); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aI); case 4: var _v5 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aY); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a2); default: var _v6 = desc; return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.N); @@ -19169,22 +21083,22 @@ var $mdgriffith$elm_ui$Internal$Style$selfName = function (desc) { switch (desc) { case 0: var _v1 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cp); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cG); case 1: var _v2 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ci); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cz); case 2: var _v3 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bv); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bF); case 3: var _v4 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bu); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bE); case 4: var _v5 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cj); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cA); default: var _v6 = desc; - return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ck); + return $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cB); } }; var $mdgriffith$elm_ui$Internal$Style$describeAlignment = function (values) { @@ -19200,7 +21114,7 @@ var $mdgriffith$elm_ui$Internal$Style$describeAlignment = function (values) { content), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2( @@ -19220,13 +21134,13 @@ var $mdgriffith$elm_ui$Internal$Style$elDescription = _List_fromArray( A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'pre'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bb), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bl), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'z-index', '0'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cw), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cM), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'z-index', '-1') @@ -19234,24 +21148,24 @@ var $mdgriffith$elm_ui$Internal$Style$elDescription = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dB), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dG), _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.q), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.s), _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.br), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'align-self', 'auto !important') @@ -19260,35 +21174,35 @@ var $mdgriffith$elm_ui$Internal$Style$elDescription = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bc), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bm), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'height', 'auto') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '100000') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.br), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ce), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cv), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bq), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bA), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'align-self', 'flex-start') @@ -19354,7 +21268,7 @@ var $mdgriffith$elm_ui$Internal$Style$elDescription = _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-top', 'auto'), @@ -19375,7 +21289,7 @@ var $mdgriffith$elm_ui$Internal$Style$gridAlignments = function (values) { [ A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2( @@ -19429,24 +21343,24 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Class, _Utils_ap( - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _Utils_ap( - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c6))), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.df))), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'block') ])), A2( $mdgriffith$elm_ui$Internal$Style$Class, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + ':focus', + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + ':focus', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'outline', 'none') ])), A2( $mdgriffith$elm_ui$Internal$Style$Class, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dw), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%'), @@ -19456,14 +21370,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, _Utils_ap( - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd)), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn)), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'height', '100%'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'height', '100%') @@ -19471,12 +21385,12 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c8), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dh), _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.av), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aw), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'fixed') @@ -19485,7 +21399,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Class, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.av), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aw), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'relative'), @@ -19495,7 +21409,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', 'auto'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), $mdgriffith$elm_ui$Internal$Style$elDescription), $mdgriffith$elm_ui$Internal$Style$Batch( function (fn) { @@ -19506,7 +21420,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( case 0: return A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cg), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cx), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'absolute'), @@ -19517,14 +21431,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin', '0 !important'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'height', 'auto') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.br), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%') @@ -19541,7 +21455,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( case 1: return A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cx), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cN), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'absolute'), @@ -19561,7 +21475,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'height', 'auto') @@ -19570,7 +21484,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( case 2: return A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.$7), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.du), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'absolute'), @@ -19591,7 +21505,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( case 3: return A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dm), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ds), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'absolute'), @@ -19612,7 +21526,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( case 4: return A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c8), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dh), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'absolute'), @@ -19633,7 +21547,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( default: return A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cw), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cM), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'absolute'), @@ -19657,7 +21571,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Class, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'position', 'relative'), @@ -19682,14 +21596,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-style', 'inherit'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bs), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bC), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-wrap', 'wrap') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bP), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.b3), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, '-moz-user-select', 'none'), @@ -19699,42 +21613,42 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cP), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c1), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'cursor', 'pointer') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cQ), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c2), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'cursor', 'text') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.du), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dz), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'pointer-events', 'none !important') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aT), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aY), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'pointer-events', 'auto !important') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ak), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aj), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '0') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ag), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ad), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '1') @@ -19742,7 +21656,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, $mdgriffith$elm_ui$Internal$Style$dot( - _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.c4, $mdgriffith$elm_ui$Internal$Style$classes.ak)) + ':hover', + _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.dd, $mdgriffith$elm_ui$Internal$Style$classes.aj)) + ':hover', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '0') @@ -19750,7 +21664,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, $mdgriffith$elm_ui$Internal$Style$dot( - _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.c4, $mdgriffith$elm_ui$Internal$Style$classes.ag)) + ':hover', + _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.dd, $mdgriffith$elm_ui$Internal$Style$classes.ad)) + ':hover', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '1') @@ -19758,7 +21672,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, $mdgriffith$elm_ui$Internal$Style$dot( - _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.cZ, $mdgriffith$elm_ui$Internal$Style$classes.ak)) + ':focus', + _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.c8, $mdgriffith$elm_ui$Internal$Style$classes.aj)) + ':focus', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '0') @@ -19766,7 +21680,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, $mdgriffith$elm_ui$Internal$Style$dot( - _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.cZ, $mdgriffith$elm_ui$Internal$Style$classes.ag)) + ':focus', + _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.c8, $mdgriffith$elm_ui$Internal$Style$classes.ad)) + ':focus', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '1') @@ -19774,7 +21688,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, $mdgriffith$elm_ui$Internal$Style$dot( - _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.a4, $mdgriffith$elm_ui$Internal$Style$classes.ak)) + ':active', + _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.bf, $mdgriffith$elm_ui$Internal$Style$classes.aj)) + ':active', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '0') @@ -19782,14 +21696,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, $mdgriffith$elm_ui$Internal$Style$dot( - _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.a4, $mdgriffith$elm_ui$Internal$Style$classes.ag)) + ':active', + _Utils_ap($mdgriffith$elm_ui$Internal$Style$classes.bf, $mdgriffith$elm_ui$Internal$Style$classes.ad)) + ':active', _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'opacity', '1') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.b8), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cp), _List_fromArray( [ A2( @@ -19808,7 +21722,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dy), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dD), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'overflow', 'auto'), @@ -19816,13 +21730,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dz), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'overflow-x', 'auto'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.A), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.B), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-shrink', '1') @@ -19830,7 +21744,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dA), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dF), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'overflow-y', 'auto'), @@ -19843,7 +21757,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-shrink', '1') @@ -19851,63 +21765,63 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cY), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'overflow', 'hidden') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cJ), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cZ), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'overflow-x', 'hidden') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cK), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c_), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'overflow-y', 'hidden') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bq), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bA), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', 'auto') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aS), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aX), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'border-width', '0') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cB), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cR), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'border-style', 'dashed') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cC), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cS), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'border-style', 'dotted') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cD), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cT), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'border-style', 'solid') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.q), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.s), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'pre'), @@ -19915,7 +21829,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.de), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'line-height', '1.05'), @@ -19923,31 +21837,31 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), $mdgriffith$elm_ui$Internal$Style$elDescription), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.A), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.B), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex'), A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-direction', 'row'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', '0%'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cu), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', 'auto') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bM), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.b_), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', 'auto') @@ -19955,28 +21869,28 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'align-self', 'stretch !important') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bH), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bU), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'align-self', 'stretch !important') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.br), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '100000') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aW), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a0), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0'), @@ -19985,20 +21899,20 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 'u:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.co, + 'u:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cF, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cm, + 's:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cD, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cj), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cA), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-left', 'auto !important') @@ -20006,13 +21920,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:last-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cm, + 's:last-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cD, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cj), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cA), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-right', 'auto !important') @@ -20020,13 +21934,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:only-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cm, + 's:only-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cD, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ck), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-top', 'auto !important'), @@ -20035,14 +21949,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:last-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cm + ' ~ u'), + 's:last-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cD + ' ~ u'), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 'u:first-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.co + (' ~ s.' + $mdgriffith$elm_ui$Internal$Style$classes.cm)), + 'u:first-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cF + (' ~ s.' + $mdgriffith$elm_ui$Internal$Style$classes.cD)), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0') @@ -20105,7 +22019,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( }), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dG), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dK), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'justify-content', 'space-between') @@ -20120,13 +22034,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-direction', 'column'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', '0%'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bG), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bT), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', 'auto') @@ -20141,48 +22055,48 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bn), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '100000') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.br), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ce), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cv), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bq), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bA), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'align-self', 'flex-start') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 'u:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cl, + 'u:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cC, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cn, + 's:first-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cE, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ck), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-top', 'auto !important'), @@ -20191,13 +22105,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:last-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cn, + 's:last-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cE, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ck), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-bottom', 'auto !important'), @@ -20206,13 +22120,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:only-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cn, + 's:only-of-type.' + $mdgriffith$elm_ui$Internal$Style$classes.cE, _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '1'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ck), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cB), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin-top', 'auto !important'), @@ -20221,14 +22135,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 's:last-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cn + ' ~ u'), + 's:last-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cE + ' ~ u'), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - 'u:first-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cl + (' ~ s.' + $mdgriffith$elm_ui$Internal$Style$classes.cn)), + 'u:first-of-type.' + ($mdgriffith$elm_ui$Internal$Style$classes.cC + (' ~ s.' + $mdgriffith$elm_ui$Internal$Style$classes.cE)), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0') @@ -20297,7 +22211,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( }), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aW), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a0), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-grow', '0'), @@ -20307,7 +22221,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dG), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dK), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'justify-content', 'space-between') @@ -20315,7 +22229,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c0), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.da), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', '-ms-grid'), @@ -20326,7 +22240,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'width', '100%') @@ -20377,13 +22291,13 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bT), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.b7), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'block'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr + ':first-child'), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI + ':first-child'), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin', '0 !important') @@ -20391,7 +22305,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Child, $mdgriffith$elm_ui$Internal$Style$dot( - $mdgriffith$elm_ui$Internal$Style$classes.cr + ($mdgriffith$elm_ui$Internal$Style$selfName(3) + (':first-child + .' + $mdgriffith$elm_ui$Internal$Style$classes.cr))), + $mdgriffith$elm_ui$Internal$Style$classes.cI + ($mdgriffith$elm_ui$Internal$Style$selfName(3) + (':first-child + .' + $mdgriffith$elm_ui$Internal$Style$classes.cI))), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin', '0 !important') @@ -20399,7 +22313,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Child, $mdgriffith$elm_ui$Internal$Style$dot( - $mdgriffith$elm_ui$Internal$Style$classes.cr + ($mdgriffith$elm_ui$Internal$Style$selfName(2) + (':first-child + .' + $mdgriffith$elm_ui$Internal$Style$classes.cr))), + $mdgriffith$elm_ui$Internal$Style$classes.cI + ($mdgriffith$elm_ui$Internal$Style$selfName(2) + (':first-child + .' + $mdgriffith$elm_ui$Internal$Style$classes.cI))), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'margin', '0 !important') @@ -20452,7 +22366,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.da), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dj), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'pre-wrap'), @@ -20462,12 +22376,12 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dd), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dm), _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'flex-basis', 'auto') @@ -20475,14 +22389,14 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dc), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dl), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'pre-wrap'), A2($mdgriffith$elm_ui$Internal$Style$Prop, 'cursor', 'text'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.db), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dk), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'pre-wrap'), @@ -20491,20 +22405,20 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bU), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.b8), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'block'), A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'normal'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bb), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bl), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'z-index', '0'), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cw), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cM), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'z-index', '-1') @@ -20512,7 +22426,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.q), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.s), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'inline'), @@ -20520,56 +22434,56 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'inline'), A2($mdgriffith$elm_ui$Internal$Style$Prop, 'white-space', 'normal'), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c8), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dh), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cw), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cM), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cg), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cx), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cx), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cN), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.$7), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.du), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dm), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.ds), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'flex') ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.q), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.s), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'inline'), @@ -20577,12 +22491,12 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dE), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dI), _List_fromArray( [ A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.q), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.s), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'inline'), @@ -20592,7 +22506,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.A), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.B), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'inline-flex') @@ -20606,7 +22520,7 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Child, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.c0), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.da), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'display', 'inline-grid') @@ -20648,84 +22562,84 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dZ), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d1), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '100') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dQ), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dU), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '200') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dU), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dY), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '300') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dW), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d_), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '400') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dV), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dZ), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '500') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dY), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d0), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '600') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cz), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cP), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '700') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dP), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dT), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '800') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dR), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dV), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-weight', '900') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.df), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.$7), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-style', 'italic') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dM), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dQ), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-decoration', 'line-through') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d2), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d6), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-decoration', 'underline'), @@ -20735,8 +22649,8 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, _Utils_ap( - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d2), - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dM)), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d6), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dQ)), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-decoration', 'line-through underline'), @@ -20745,42 +22659,42 @@ var $mdgriffith$elm_ui$Internal$Style$baseSheet = _List_fromArray( ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d_), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d2), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'font-style', 'normal') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dS), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dW), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-align', 'justify') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a2), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.bc), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-align', 'justify-all') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dO), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dS), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-align', 'center') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dX), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.d$), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-align', 'right') ])), A2( $mdgriffith$elm_ui$Internal$Style$Descriptor, - $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dT), + $mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.dX), _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Style$Prop, 'text-align', 'left') @@ -20892,19 +22806,19 @@ var $mdgriffith$elm_ui$Internal$Style$commonValues = $elm$core$List$concat( $mdgriffith$elm_ui$Internal$Style$fontVariant('afrc'), $mdgriffith$elm_ui$Internal$Style$fontVariant('frac') ])); -var $mdgriffith$elm_ui$Internal$Style$explainer = '\n.explain {\n border: 6px solid rgb(174, 121, 15) !important;\n}\n.explain > .' + ($mdgriffith$elm_ui$Internal$Style$classes.cr + (' {\n border: 4px dashed rgb(0, 151, 167) !important;\n}\n\n.ctr {\n border: none !important;\n}\n.explain > .ctr > .' + ($mdgriffith$elm_ui$Internal$Style$classes.cr + ' {\n border: 4px dashed rgb(0, 151, 167) !important;\n}\n\n'))); +var $mdgriffith$elm_ui$Internal$Style$explainer = '\n.explain {\n border: 6px solid rgb(174, 121, 15) !important;\n}\n.explain > .' + ($mdgriffith$elm_ui$Internal$Style$classes.cI + (' {\n border: 4px dashed rgb(0, 151, 167) !important;\n}\n\n.ctr {\n border: none !important;\n}\n.explain > .ctr > .' + ($mdgriffith$elm_ui$Internal$Style$classes.cI + ' {\n border: 4px dashed rgb(0, 151, 167) !important;\n}\n\n'))); var $mdgriffith$elm_ui$Internal$Style$inputTextReset = '\ninput[type="search"],\ninput[type="search"]::-webkit-search-decoration,\ninput[type="search"]::-webkit-search-cancel-button,\ninput[type="search"]::-webkit-search-results-button,\ninput[type="search"]::-webkit-search-results-decoration {\n -webkit-appearance:none;\n}\n'; var $mdgriffith$elm_ui$Internal$Style$sliderReset = '\ninput[type=range] {\n -webkit-appearance: none; \n background: transparent;\n position:absolute;\n left:0;\n top:0;\n z-index:10;\n width: 100%;\n outline: dashed 1px;\n height: 100%;\n opacity: 0;\n}\n'; var $mdgriffith$elm_ui$Internal$Style$thumbReset = '\ninput[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n opacity: 0.5;\n width: 80px;\n height: 80px;\n background-color: black;\n border:none;\n border-radius: 5px;\n}\ninput[type=range]::-moz-range-thumb {\n opacity: 0.5;\n width: 80px;\n height: 80px;\n background-color: black;\n border:none;\n border-radius: 5px;\n}\ninput[type=range]::-ms-thumb {\n opacity: 0.5;\n width: 80px;\n height: 80px;\n background-color: black;\n border:none;\n border-radius: 5px;\n}\ninput[type=range][orient=vertical]{\n writing-mode: bt-lr; /* IE */\n -webkit-appearance: slider-vertical; /* WebKit */\n}\n'; var $mdgriffith$elm_ui$Internal$Style$trackReset = '\ninput[type=range]::-moz-range-track {\n background: transparent;\n cursor: pointer;\n}\ninput[type=range]::-ms-track {\n background: transparent;\n cursor: pointer;\n}\ninput[type=range]::-webkit-slider-runnable-track {\n background: transparent;\n cursor: pointer;\n}\n'; -var $mdgriffith$elm_ui$Internal$Style$overrides = '@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.A) + (' > ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + (' { flex-basis: auto !important; } ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.A) + (' > ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cr) + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.aW) + (' { flex-basis: auto !important; }}' + ($mdgriffith$elm_ui$Internal$Style$inputTextReset + ($mdgriffith$elm_ui$Internal$Style$sliderReset + ($mdgriffith$elm_ui$Internal$Style$trackReset + ($mdgriffith$elm_ui$Internal$Style$thumbReset + $mdgriffith$elm_ui$Internal$Style$explainer))))))))))))))); +var $mdgriffith$elm_ui$Internal$Style$overrides = '@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.B) + (' > ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + (' { flex-basis: auto !important; } ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.B) + (' > ' + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.cI) + ($mdgriffith$elm_ui$Internal$Style$dot($mdgriffith$elm_ui$Internal$Style$classes.a0) + (' { flex-basis: auto !important; }}' + ($mdgriffith$elm_ui$Internal$Style$inputTextReset + ($mdgriffith$elm_ui$Internal$Style$sliderReset + ($mdgriffith$elm_ui$Internal$Style$trackReset + ($mdgriffith$elm_ui$Internal$Style$thumbReset + $mdgriffith$elm_ui$Internal$Style$explainer))))))))))))))); var $elm$core$String$concat = function (strings) { return A2($elm$core$String$join, '', strings); }; var $mdgriffith$elm_ui$Internal$Style$Intermediate = $elm$core$Basics$identity; var $mdgriffith$elm_ui$Internal$Style$emptyIntermediate = F2( function (selector, closing) { - return {aU: closing, j: _List_Nil, T: _List_Nil, G: selector}; + return {aZ: closing, l: _List_Nil, T: _List_Nil, H: selector}; }); var $mdgriffith$elm_ui$Internal$Style$renderRules = F2( function (_v0, rulesToRender) { @@ -20931,10 +22845,10 @@ var $mdgriffith$elm_ui$Internal$Style$renderRules = F2( return _Utils_update( rendered, { - j: A2( + l: A2( $elm$core$List$cons, - {aU: '\n}', j: _List_Nil, T: props, G: '@supports (' + (prop + (':' + (value + (') {' + parent.G))))}, - rendered.j) + {aZ: '\n}', l: _List_Nil, T: props, H: '@supports (' + (prop + (':' + (value + (') {' + parent.H))))}, + rendered.l) }); case 4: var selector = rule.a; @@ -20942,13 +22856,13 @@ var $mdgriffith$elm_ui$Internal$Style$renderRules = F2( return _Utils_update( rendered, { - j: A2( + l: A2( $elm$core$List$cons, A2( $mdgriffith$elm_ui$Internal$Style$renderRules, - A2($mdgriffith$elm_ui$Internal$Style$emptyIntermediate, parent.G + (' + ' + selector), ''), + A2($mdgriffith$elm_ui$Internal$Style$emptyIntermediate, parent.H + (' + ' + selector), ''), adjRules), - rendered.j) + rendered.l) }); case 1: var child = rule.a; @@ -20956,13 +22870,13 @@ var $mdgriffith$elm_ui$Internal$Style$renderRules = F2( return _Utils_update( rendered, { - j: A2( + l: A2( $elm$core$List$cons, A2( $mdgriffith$elm_ui$Internal$Style$renderRules, - A2($mdgriffith$elm_ui$Internal$Style$emptyIntermediate, parent.G + (' > ' + child), ''), + A2($mdgriffith$elm_ui$Internal$Style$emptyIntermediate, parent.H + (' > ' + child), ''), childRules), - rendered.j) + rendered.l) }); case 3: var descriptor = rule.a; @@ -20970,29 +22884,29 @@ var $mdgriffith$elm_ui$Internal$Style$renderRules = F2( return _Utils_update( rendered, { - j: A2( + l: A2( $elm$core$List$cons, A2( $mdgriffith$elm_ui$Internal$Style$renderRules, A2( $mdgriffith$elm_ui$Internal$Style$emptyIntermediate, - _Utils_ap(parent.G, descriptor), + _Utils_ap(parent.H, descriptor), ''), descriptorRules), - rendered.j) + rendered.l) }); default: var batched = rule.a; return _Utils_update( rendered, { - j: A2( + l: A2( $elm$core$List$cons, A2( $mdgriffith$elm_ui$Internal$Style$renderRules, - A2($mdgriffith$elm_ui$Internal$Style$emptyIntermediate, parent.G, ''), + A2($mdgriffith$elm_ui$Internal$Style$emptyIntermediate, parent.H, ''), batched), - rendered.j) + rendered.l) }); } }); @@ -21015,7 +22929,7 @@ var $mdgriffith$elm_ui$Internal$Style$renderCompact = function (styleClasses) { if (!_v2.b) { return ''; } else { - return rule.G + ('{' + (renderValues(rule.T) + (rule.aU + '}'))); + return rule.H + ('{' + (renderValues(rule.T) + (rule.aZ + '}'))); } }; var renderIntermediate = function (_v0) { @@ -21023,7 +22937,7 @@ var $mdgriffith$elm_ui$Internal$Style$renderCompact = function (styleClasses) { return _Utils_ap( renderClass(rule), $elm$core$String$concat( - A2($elm$core$List$map, renderIntermediate, rule.j))); + A2($elm$core$List$map, renderIntermediate, rule.l))); }; return $elm$core$String$concat( A2( @@ -21051,7 +22965,7 @@ var $mdgriffith$elm_ui$Internal$Style$rules = _Utils_ap( $mdgriffith$elm_ui$Internal$Style$renderCompact( _Utils_ap($mdgriffith$elm_ui$Internal$Style$baseSheet, $mdgriffith$elm_ui$Internal$Style$commonValues))); var $mdgriffith$elm_ui$Internal$Model$staticRoot = function (opts) { - var _v0 = opts.di; + var _v0 = opts.dq; switch (_v0) { case 0: return A3( @@ -21123,7 +23037,7 @@ var $mdgriffith$elm_ui$Internal$Model$fontName = function (font) { var url = font.b; return '\"' + (name + '\"'); default: - var name = font.a.dl; + var name = font.a.dr; return '\"' + (name + '\"'); } }; @@ -21144,7 +23058,7 @@ var $mdgriffith$elm_ui$Internal$Model$isSmallCaps = function (_var) { var $mdgriffith$elm_ui$Internal$Model$hasSmallCaps = function (typeface) { if (typeface.$ === 5) { var font = typeface.a; - return A2($elm$core$List$any, $mdgriffith$elm_ui$Internal$Model$isSmallCaps, font.ca); + return A2($elm$core$List$any, $mdgriffith$elm_ui$Internal$Model$isSmallCaps, font.cr); } else { return false; } @@ -21174,7 +23088,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderStyle = F4( var pseudo = maybePseudo.a; switch (pseudo) { case 1: - var _v2 = options.c4; + var _v2 = options.dd; switch (_v2) { case 0: return _List_Nil; @@ -21204,7 +23118,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderStyle = F4( '', props); return _List_fromArray( - [selector + ('-fs:focus {' + (renderedProps + '\n}')), '.' + ($mdgriffith$elm_ui$Internal$Style$classes.cr + (':focus ~ ' + (selector + ('-fs:not(.focus) {' + (renderedProps + '\n}'))))), '.' + ($mdgriffith$elm_ui$Internal$Style$classes.cr + (':focus ' + (selector + ('-fs {' + (renderedProps + '\n}'))))), selector + ('-fs:focus-within {' + (renderedProps + '\n}')), '.focusable-parent:focus ~ ' + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + (selector + ('-fs {' + (renderedProps + '\n}'))))))]); + [selector + ('-fs:focus {' + (renderedProps + '\n}')), '.' + ($mdgriffith$elm_ui$Internal$Style$classes.cI + (':focus ~ ' + (selector + ('-fs:not(.focus) {' + (renderedProps + '\n}'))))), '.' + ($mdgriffith$elm_ui$Internal$Style$classes.cI + (':focus ' + (selector + ('-fs {' + (renderedProps + '\n}'))))), selector + ('-fs:focus-within {' + (renderedProps + '\n}')), '.focusable-parent:focus ~ ' + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + (selector + ('-fs {' + (renderedProps + '\n}'))))))]); default: return _List_fromArray( [ @@ -21238,7 +23152,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderVariants = function (typeface) { A2( $elm$core$String$join, ', ', - A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$renderVariant, font.ca))); + A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$renderVariant, font.cr))); } else { return $elm$core$Maybe$Nothing; } @@ -21384,18 +23298,18 @@ var $mdgriffith$elm_ui$Internal$Model$renderStyleRule = F3( var y = rule.c; var yPx = $elm$core$String$fromInt(y) + 'px'; var xPx = $elm$core$String$fromInt(x) + 'px'; - var single = '.' + $mdgriffith$elm_ui$Internal$Style$classes.dE; - var row = '.' + $mdgriffith$elm_ui$Internal$Style$classes.A; - var wrappedRow = '.' + ($mdgriffith$elm_ui$Internal$Style$classes.bs + row); - var right = '.' + $mdgriffith$elm_ui$Internal$Style$classes.bv; - var paragraph = '.' + $mdgriffith$elm_ui$Internal$Style$classes.bU; - var page = '.' + $mdgriffith$elm_ui$Internal$Style$classes.bT; - var left = '.' + $mdgriffith$elm_ui$Internal$Style$classes.bu; + var single = '.' + $mdgriffith$elm_ui$Internal$Style$classes.dI; + var row = '.' + $mdgriffith$elm_ui$Internal$Style$classes.B; + var wrappedRow = '.' + ($mdgriffith$elm_ui$Internal$Style$classes.bC + row); + var right = '.' + $mdgriffith$elm_ui$Internal$Style$classes.bF; + var paragraph = '.' + $mdgriffith$elm_ui$Internal$Style$classes.b8; + var page = '.' + $mdgriffith$elm_ui$Internal$Style$classes.b7; + var left = '.' + $mdgriffith$elm_ui$Internal$Style$classes.bE; var halfY = $elm$core$String$fromFloat(y / 2) + 'px'; var halfX = $elm$core$String$fromFloat(x / 2) + 'px'; var column = '.' + $mdgriffith$elm_ui$Internal$Style$classes.L; var _class = '.' + cls; - var any = '.' + $mdgriffith$elm_ui$Internal$Style$classes.cr; + var any = '.' + $mdgriffith$elm_ui$Internal$Style$classes.cI; return $elm$core$List$concat( _List_fromArray( [ @@ -21653,45 +23567,45 @@ var $mdgriffith$elm_ui$Internal$Model$renderStyleRule = F3( var toGridLength = function (x) { return A3(toGridLengthHelper, $elm$core$Maybe$Nothing, $elm$core$Maybe$Nothing, x); }; - var xSpacing = toGridLength(template.dH.a); - var ySpacing = toGridLength(template.dH.b); + var xSpacing = toGridLength(template.dL.a); + var ySpacing = toGridLength(template.dL.b); var rows = function (x) { return 'grid-template-rows: ' + (x + ';'); }( A2( $elm$core$String$join, ' ', - A2($elm$core$List$map, toGridLength, template.dx))); + A2($elm$core$List$map, toGridLength, template.dC))); var msRows = function (x) { return '-ms-grid-rows: ' + (x + ';'); }( A2( $elm$core$String$join, ySpacing, - A2($elm$core$List$map, toGridLength, template.D))); + A2($elm$core$List$map, toGridLength, template.E))); var msColumns = function (x) { return '-ms-grid-columns: ' + (x + ';'); }( A2( $elm$core$String$join, ySpacing, - A2($elm$core$List$map, toGridLength, template.D))); - var gapY = 'grid-row-gap:' + (toGridLength(template.dH.b) + ';'); - var gapX = 'grid-column-gap:' + (toGridLength(template.dH.a) + ';'); + A2($elm$core$List$map, toGridLength, template.E))); + var gapY = 'grid-row-gap:' + (toGridLength(template.dL.b) + ';'); + var gapX = 'grid-column-gap:' + (toGridLength(template.dL.a) + ';'); var columns = function (x) { return 'grid-template-columns: ' + (x + ';'); }( A2( $elm$core$String$join, ' ', - A2($elm$core$List$map, toGridLength, template.D))); + A2($elm$core$List$map, toGridLength, template.E))); var _class = '.grid-rows-' + (A2( $elm$core$String$join, '-', - A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.dx)) + ('-cols-' + (A2( + A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.dC)) + ('-cols-' + (A2( $elm$core$String$join, '-', - A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.D)) + ('-space-x-' + ($mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dH.a) + ('-space-y-' + $mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dH.b))))))); + A2($elm$core$List$map, $mdgriffith$elm_ui$Internal$Model$lengthClassName, template.E)) + ('-space-x-' + ($mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dL.a) + ('-space-y-' + $mdgriffith$elm_ui$Internal$Model$lengthClassName(template.dL.b))))))); var modernGrid = _class + ('{' + (columns + (rows + (gapX + (gapY + '}'))))); var supports = '@supports (display:grid) {' + (modernGrid + '}'); var base = _class + ('{' + (msColumns + (msRows + '}'))); @@ -21704,20 +23618,20 @@ var $mdgriffith$elm_ui$Internal$Model$renderStyleRule = F3( ' ', _List_fromArray( [ - '-ms-grid-row: ' + ($elm$core$String$fromInt(position.A) + ';'), - '-ms-grid-row-span: ' + ($elm$core$String$fromInt(position.c2) + ';'), - '-ms-grid-column: ' + ($elm$core$String$fromInt(position.cL) + ';'), - '-ms-grid-column-span: ' + ($elm$core$String$fromInt(position.d4) + ';') + '-ms-grid-row: ' + ($elm$core$String$fromInt(position.B) + ';'), + '-ms-grid-row-span: ' + ($elm$core$String$fromInt(position.db) + ';'), + '-ms-grid-column: ' + ($elm$core$String$fromInt(position.c$) + ';'), + '-ms-grid-column-span: ' + ($elm$core$String$fromInt(position.aW) + ';') ])); var modernPosition = A2( $elm$core$String$join, ' ', _List_fromArray( [ - 'grid-row: ' + ($elm$core$String$fromInt(position.A) + (' / ' + ($elm$core$String$fromInt(position.A + position.c2) + ';'))), - 'grid-column: ' + ($elm$core$String$fromInt(position.cL) + (' / ' + ($elm$core$String$fromInt(position.cL + position.d4) + ';'))) + 'grid-row: ' + ($elm$core$String$fromInt(position.B) + (' / ' + ($elm$core$String$fromInt(position.B + position.db) + ';'))), + 'grid-column: ' + ($elm$core$String$fromInt(position.c$) + (' / ' + ($elm$core$String$fromInt(position.c$ + position.aW) + ';'))) ])); - var _class = '.grid-pos-' + ($elm$core$String$fromInt(position.A) + ('-' + ($elm$core$String$fromInt(position.cL) + ('-' + ($elm$core$String$fromInt(position.d4) + ('-' + $elm$core$String$fromInt(position.c2))))))); + var _class = '.grid-pos-' + ($elm$core$String$fromInt(position.B) + ('-' + ($elm$core$String$fromInt(position.c$) + ('-' + ($elm$core$String$fromInt(position.aW) + ('-' + $elm$core$String$fromInt(position.db))))))); var modernGrid = _class + ('{' + (modernPosition + '}')); var supports = '@supports (display:grid) {' + (modernGrid + '}'); var base = _class + ('{' + (msPosition + '}')); @@ -21788,7 +23702,7 @@ var $mdgriffith$elm_ui$Internal$Model$fontRule = F3( return _List_fromArray( [ A2($mdgriffith$elm_ui$Internal$Model$bracket, '.' + (name + ('.' + (modifier + (', ' + ('.' + (name + (' .' + modifier))))))), parentAdj), - A2($mdgriffith$elm_ui$Internal$Model$bracket, '.' + (name + ('.' + (modifier + ('> .' + ($mdgriffith$elm_ui$Internal$Style$classes.q + (', .' + (name + (' .' + (modifier + (' > .' + $mdgriffith$elm_ui$Internal$Style$classes.q)))))))))), textAdjustment) + A2($mdgriffith$elm_ui$Internal$Model$bracket, '.' + (name + ('.' + (modifier + ('> .' + ($mdgriffith$elm_ui$Internal$Style$classes.s + (', .' + (name + (' .' + (modifier + (' > .' + $mdgriffith$elm_ui$Internal$Style$classes.s)))))))))), textAdjustment) ]); }); var $mdgriffith$elm_ui$Internal$Model$renderFontAdjustmentRule = F3( @@ -21800,8 +23714,8 @@ var $mdgriffith$elm_ui$Internal$Model$renderFontAdjustmentRule = F3( $elm$core$String$join, ' ', _Utils_ap( - A3($mdgriffith$elm_ui$Internal$Model$fontRule, name, $mdgriffith$elm_ui$Internal$Style$classes.dF, capital), - A3($mdgriffith$elm_ui$Internal$Model$fontRule, name, $mdgriffith$elm_ui$Internal$Style$classes.c_, full))); + A3($mdgriffith$elm_ui$Internal$Model$fontRule, name, $mdgriffith$elm_ui$Internal$Style$classes.dJ, capital), + A3($mdgriffith$elm_ui$Internal$Model$fontRule, name, $mdgriffith$elm_ui$Internal$Style$classes.c9, full))); }); var $mdgriffith$elm_ui$Internal$Model$renderNullAdjustmentRule = F2( function (fontToAdjust, otherFontName) { @@ -21813,14 +23727,14 @@ var $mdgriffith$elm_ui$Internal$Model$renderNullAdjustmentRule = F2( [ A2( $mdgriffith$elm_ui$Internal$Model$bracket, - '.' + (name + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.dF + (', ' + ('.' + (name + (' .' + $mdgriffith$elm_ui$Internal$Style$classes.dF))))))), + '.' + (name + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.dJ + (', ' + ('.' + (name + (' .' + $mdgriffith$elm_ui$Internal$Style$classes.dJ))))))), _List_fromArray( [ _Utils_Tuple2('line-height', '1') ])), A2( $mdgriffith$elm_ui$Internal$Model$bracket, - '.' + (name + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.dF + ('> .' + ($mdgriffith$elm_ui$Internal$Style$classes.q + (', .' + (name + (' .' + ($mdgriffith$elm_ui$Internal$Style$classes.dF + (' > .' + $mdgriffith$elm_ui$Internal$Style$classes.q)))))))))), + '.' + (name + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.dJ + ('> .' + ($mdgriffith$elm_ui$Internal$Style$classes.s + (', .' + (name + (' .' + ($mdgriffith$elm_ui$Internal$Style$classes.dJ + (' > .' + $mdgriffith$elm_ui$Internal$Style$classes.s)))))))))), _List_fromArray( [ _Utils_Tuple2('vertical-align', '0'), @@ -21830,7 +23744,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderNullAdjustmentRule = F2( }); var $mdgriffith$elm_ui$Internal$Model$adjust = F3( function (size, height, vertical) { - return {c2: height / size, aJ: size, cb: vertical}; + return {db: height / size, aO: size, cs: vertical}; }); var $elm$core$List$maximum = function (list) { if (list.b) { @@ -21854,17 +23768,17 @@ var $elm$core$List$minimum = function (list) { }; var $mdgriffith$elm_ui$Internal$Model$convertAdjustment = function (adjustment) { var lines = _List_fromArray( - [adjustment.cG, adjustment.cu, adjustment.cR, adjustment.dh]); + [adjustment.cW, adjustment.cL, adjustment.c3, adjustment.dp]); var lineHeight = 1.5; var normalDescender = (lineHeight - 1) / 2; var oldMiddle = lineHeight / 2; var descender = A2( $elm$core$Maybe$withDefault, - adjustment.cR, + adjustment.c3, $elm$core$List$minimum(lines)); var newBaseline = A2( $elm$core$Maybe$withDefault, - adjustment.cu, + adjustment.cL, $elm$core$List$minimum( A2( $elm$core$List$filter, @@ -21875,7 +23789,7 @@ var $mdgriffith$elm_ui$Internal$Model$convertAdjustment = function (adjustment) var base = lineHeight; var ascender = A2( $elm$core$Maybe$withDefault, - adjustment.cG, + adjustment.cW, $elm$core$List$maximum(lines)); var capitalSize = 1 / (ascender - newBaseline); var capitalVertical = 1 - ascender; @@ -21884,8 +23798,8 @@ var $mdgriffith$elm_ui$Internal$Model$convertAdjustment = function (adjustment) var newCapitalMiddle = ((ascender - newBaseline) / 2) + newBaseline; var newFullMiddle = ((ascender - descender) / 2) + descender; return { - cG: A3($mdgriffith$elm_ui$Internal$Model$adjust, capitalSize, ascender - newBaseline, capitalVertical), - bF: A3($mdgriffith$elm_ui$Internal$Model$adjust, fullSize, ascender - descender, fullVertical) + cW: A3($mdgriffith$elm_ui$Internal$Model$adjust, capitalSize, ascender - newBaseline, capitalVertical), + bR: A3($mdgriffith$elm_ui$Internal$Model$adjust, fullSize, ascender - descender, fullVertical) }; }; var $mdgriffith$elm_ui$Internal$Model$fontAdjustmentRules = function (converted) { @@ -21899,13 +23813,13 @@ var $mdgriffith$elm_ui$Internal$Model$fontAdjustmentRules = function (converted) _Utils_Tuple2('display', 'inline-block'), _Utils_Tuple2( 'line-height', - $elm$core$String$fromFloat(converted.c2)), + $elm$core$String$fromFloat(converted.db)), _Utils_Tuple2( 'vertical-align', - $elm$core$String$fromFloat(converted.cb) + 'em'), + $elm$core$String$fromFloat(converted.cs) + 'em'), _Utils_Tuple2( 'font-size', - $elm$core$String$fromFloat(converted.aJ) + 'em') + $elm$core$String$fromFloat(converted.aO) + 'em') ])); }; var $mdgriffith$elm_ui$Internal$Model$typefaceAdjustment = function (typefaces) { @@ -21916,7 +23830,7 @@ var $mdgriffith$elm_ui$Internal$Model$typefaceAdjustment = function (typefaces) if (found.$ === 1) { if (face.$ === 5) { var _with = face.a; - var _v2 = _with.ch; + var _v2 = _with.cy; if (_v2.$ === 1) { return found; } else { @@ -21925,12 +23839,12 @@ var $mdgriffith$elm_ui$Internal$Model$typefaceAdjustment = function (typefaces) _Utils_Tuple2( $mdgriffith$elm_ui$Internal$Model$fontAdjustmentRules( function ($) { - return $.bF; + return $.bR; }( $mdgriffith$elm_ui$Internal$Model$convertAdjustment(adjustment))), $mdgriffith$elm_ui$Internal$Model$fontAdjustmentRules( function ($) { - return $.cG; + return $.cW; }( $mdgriffith$elm_ui$Internal$Model$convertAdjustment(adjustment))))); } @@ -22011,16 +23925,16 @@ var $mdgriffith$elm_ui$Internal$Model$toStyleSheetString = F2( var combine = F2( function (style, rendered) { return { - a0: _Utils_ap( - rendered.a0, + ba: _Utils_ap( + rendered.ba, A3($mdgriffith$elm_ui$Internal$Model$renderStyleRule, options, style, $elm$core$Maybe$Nothing)), - aO: function () { + aS: function () { var _v1 = $mdgriffith$elm_ui$Internal$Model$topLevelValue(style); if (_v1.$ === 1) { - return rendered.aO; + return rendered.aS; } else { var topLevel = _v1.a; - return A2($elm$core$List$cons, topLevel, rendered.aO); + return A2($elm$core$List$cons, topLevel, rendered.aS); } }() }; @@ -22028,17 +23942,17 @@ var $mdgriffith$elm_ui$Internal$Model$toStyleSheetString = F2( var _v0 = A3( $elm$core$List$foldl, combine, - {a0: _List_Nil, aO: _List_Nil}, + {ba: _List_Nil, aS: _List_Nil}, stylesheet); - var topLevel = _v0.aO; - var rules = _v0.a0; + var topLevel = _v0.aS; + var rules = _v0.ba; return _Utils_ap( $mdgriffith$elm_ui$Internal$Model$renderTopLevelValues(topLevel), $elm$core$String$concat(rules)); }); var $mdgriffith$elm_ui$Internal$Model$toStyleSheet = F2( function (options, styleSheet) { - var _v0 = options.di; + var _v0 = options.dq; switch (_v0) { case 0: return A3( @@ -22098,7 +24012,7 @@ var $mdgriffith$elm_ui$Internal$Model$embedKeyed = F4( $mdgriffith$elm_ui$Internal$Model$reduceStyles, _Utils_Tuple2( $elm$core$Set$empty, - $mdgriffith$elm_ui$Internal$Model$renderFocusStyle(opts.cZ)), + $mdgriffith$elm_ui$Internal$Model$renderFocusStyle(opts.c8)), styles).b); return _static ? A2( $elm$core$List$cons, @@ -22123,7 +24037,7 @@ var $mdgriffith$elm_ui$Internal$Model$embedWith = F4( $mdgriffith$elm_ui$Internal$Model$reduceStyles, _Utils_Tuple2( $elm$core$Set$empty, - $mdgriffith$elm_ui$Internal$Model$renderFocusStyle(opts.cZ)), + $mdgriffith$elm_ui$Internal$Model$renderFocusStyle(opts.c8)), styles).b); return _static ? A2( $elm$core$List$cons, @@ -22227,7 +24141,7 @@ var $mdgriffith$elm_ui$Internal$Model$finalizeNode = F6( internal, _List_fromArray( [ - $elm$html$Html$Attributes$class($mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.dE)) + $elm$html$Html$Attributes$class($mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.dI)) ])) ])); } @@ -22243,7 +24157,7 @@ var $mdgriffith$elm_ui$Internal$Model$finalizeNode = F6( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.cr, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.aW, $mdgriffith$elm_ui$Internal$Style$classes.N, $mdgriffith$elm_ui$Internal$Style$classes.co]))) + [$mdgriffith$elm_ui$Internal$Style$classes.cI, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.a0, $mdgriffith$elm_ui$Internal$Style$classes.N, $mdgriffith$elm_ui$Internal$Style$classes.cF]))) ]), _List_fromArray( [html])) : (A2($mdgriffith$elm_ui$Internal$Flag$present, $mdgriffith$elm_ui$Internal$Flag$centerX, has) ? A2( @@ -22255,7 +24169,7 @@ var $mdgriffith$elm_ui$Internal$Model$finalizeNode = F6( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.cr, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.aW, $mdgriffith$elm_ui$Internal$Style$classes.N, $mdgriffith$elm_ui$Internal$Style$classes.cm]))) + [$mdgriffith$elm_ui$Internal$Style$classes.cI, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.a0, $mdgriffith$elm_ui$Internal$Style$classes.N, $mdgriffith$elm_ui$Internal$Style$classes.cD]))) ]), _List_fromArray( [html])) : html)); @@ -22269,7 +24183,7 @@ var $mdgriffith$elm_ui$Internal$Model$finalizeNode = F6( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.cr, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.aW, $mdgriffith$elm_ui$Internal$Style$classes.cn]))) + [$mdgriffith$elm_ui$Internal$Style$classes.cI, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.a0, $mdgriffith$elm_ui$Internal$Style$classes.cE]))) ]), _List_fromArray( [html])) : (A2($mdgriffith$elm_ui$Internal$Flag$present, $mdgriffith$elm_ui$Internal$Flag$alignBottom, has) ? A2( @@ -22281,7 +24195,7 @@ var $mdgriffith$elm_ui$Internal$Model$finalizeNode = F6( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.cr, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.aW, $mdgriffith$elm_ui$Internal$Style$classes.cl]))) + [$mdgriffith$elm_ui$Internal$Style$classes.cI, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.a0, $mdgriffith$elm_ui$Internal$Style$classes.cC]))) ]), _List_fromArray( [html])) : html)); @@ -22289,7 +24203,7 @@ var $mdgriffith$elm_ui$Internal$Model$finalizeNode = F6( return html; } }); -var $mdgriffith$elm_ui$Internal$Model$textElementClasses = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.q + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.bq + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bc))))); +var $mdgriffith$elm_ui$Internal$Model$textElementClasses = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.s + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.bA + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bm))))); var $mdgriffith$elm_ui$Internal$Model$textElement = function (str) { return A2( $elm$html$Html$div, @@ -22302,7 +24216,7 @@ var $mdgriffith$elm_ui$Internal$Model$textElement = function (str) { $elm$html$Html$text(str) ])); }; -var $mdgriffith$elm_ui$Internal$Model$textElementFillClasses = $mdgriffith$elm_ui$Internal$Style$classes.cr + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.q + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.br + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bd))))); +var $mdgriffith$elm_ui$Internal$Model$textElementFillClasses = $mdgriffith$elm_ui$Internal$Style$classes.cI + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.s + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.bB + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bn))))); var $mdgriffith$elm_ui$Internal$Model$textElementFill = function (str) { return A2( $elm$html$Html$div, @@ -22348,16 +24262,16 @@ var $mdgriffith$elm_ui$Internal$Model$createElement = F3( $elm$core$List$cons, _Utils_Tuple2( key, - A2(styled.c5, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context)), + A2(styled.de, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context)), htmls), - $elm$core$List$isEmpty(existingStyles) ? styled.dN : _Utils_ap(styled.dN, existingStyles)) : _Utils_Tuple2( + $elm$core$List$isEmpty(existingStyles) ? styled.dR : _Utils_ap(styled.dR, existingStyles)) : _Utils_Tuple2( A2( $elm$core$List$cons, _Utils_Tuple2( key, - A2(styled.c5, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context)), + A2(styled.de, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context)), htmls), - $elm$core$List$isEmpty(existingStyles) ? styled.dN : _Utils_ap(styled.dN, existingStyles)); + $elm$core$List$isEmpty(existingStyles) ? styled.dR : _Utils_ap(styled.dR, existingStyles)); case 2: var str = child.a; return _Utils_Tuple2( @@ -22395,14 +24309,14 @@ var $mdgriffith$elm_ui$Internal$Model$createElement = F3( return _Utils_eq(context, $mdgriffith$elm_ui$Internal$Model$asParagraph) ? _Utils_Tuple2( A2( $elm$core$List$cons, - A2(styled.c5, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context), + A2(styled.de, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context), htmls), - $elm$core$List$isEmpty(existingStyles) ? styled.dN : _Utils_ap(styled.dN, existingStyles)) : _Utils_Tuple2( + $elm$core$List$isEmpty(existingStyles) ? styled.dR : _Utils_ap(styled.dR, existingStyles)) : _Utils_Tuple2( A2( $elm$core$List$cons, - A2(styled.c5, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context), + A2(styled.de, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, context), htmls), - $elm$core$List$isEmpty(existingStyles) ? styled.dN : _Utils_ap(styled.dN, existingStyles)); + $elm$core$List$isEmpty(existingStyles) ? styled.dR : _Utils_ap(styled.dR, existingStyles)); case 2: var str = child.a; return _Utils_Tuple2( @@ -22424,29 +24338,29 @@ var $mdgriffith$elm_ui$Internal$Model$createElement = F3( keyedChildren); var keyed = _v1.a; var styles = _v1.b; - var newStyles = $elm$core$List$isEmpty(styles) ? rendered.dN : _Utils_ap(rendered.dN, styles); + var newStyles = $elm$core$List$isEmpty(styles) ? rendered.dR : _Utils_ap(rendered.dR, styles); if (!newStyles.b) { return $mdgriffith$elm_ui$Internal$Model$Unstyled( A5( $mdgriffith$elm_ui$Internal$Model$finalizeNode, - rendered.ae, - rendered.af, - rendered.X, + rendered.ab, + rendered.ac, + rendered.V, $mdgriffith$elm_ui$Internal$Model$Keyed( - A3($mdgriffith$elm_ui$Internal$Model$addKeyedChildren, 'nearby-element-pls', keyed, rendered.Z)), + A3($mdgriffith$elm_ui$Internal$Model$addKeyedChildren, 'nearby-element-pls', keyed, rendered.X)), $mdgriffith$elm_ui$Internal$Model$NoStyleSheet)); } else { var allStyles = newStyles; return $mdgriffith$elm_ui$Internal$Model$Styled( { - c5: A4( + de: A4( $mdgriffith$elm_ui$Internal$Model$finalizeNode, - rendered.ae, - rendered.af, - rendered.X, + rendered.ab, + rendered.ac, + rendered.V, $mdgriffith$elm_ui$Internal$Model$Keyed( - A3($mdgriffith$elm_ui$Internal$Model$addKeyedChildren, 'nearby-element-pls', keyed, rendered.Z))), - dN: allStyles + A3($mdgriffith$elm_ui$Internal$Model$addKeyedChildren, 'nearby-element-pls', keyed, rendered.X))), + dR: allStyles }); } } else { @@ -22458,29 +24372,29 @@ var $mdgriffith$elm_ui$Internal$Model$createElement = F3( unkeyedChildren); var unkeyed = _v3.a; var styles = _v3.b; - var newStyles = $elm$core$List$isEmpty(styles) ? rendered.dN : _Utils_ap(rendered.dN, styles); + var newStyles = $elm$core$List$isEmpty(styles) ? rendered.dR : _Utils_ap(rendered.dR, styles); if (!newStyles.b) { return $mdgriffith$elm_ui$Internal$Model$Unstyled( A5( $mdgriffith$elm_ui$Internal$Model$finalizeNode, - rendered.ae, - rendered.af, - rendered.X, + rendered.ab, + rendered.ac, + rendered.V, $mdgriffith$elm_ui$Internal$Model$Unkeyed( - A2($mdgriffith$elm_ui$Internal$Model$addChildren, unkeyed, rendered.Z)), + A2($mdgriffith$elm_ui$Internal$Model$addChildren, unkeyed, rendered.X)), $mdgriffith$elm_ui$Internal$Model$NoStyleSheet)); } else { var allStyles = newStyles; return $mdgriffith$elm_ui$Internal$Model$Styled( { - c5: A4( + de: A4( $mdgriffith$elm_ui$Internal$Model$finalizeNode, - rendered.ae, - rendered.af, - rendered.X, + rendered.ab, + rendered.ac, + rendered.V, $mdgriffith$elm_ui$Internal$Model$Unkeyed( - A2($mdgriffith$elm_ui$Internal$Model$addChildren, unkeyed, rendered.Z))), - dN: allStyles + A2($mdgriffith$elm_ui$Internal$Model$addChildren, unkeyed, rendered.X))), + dR: allStyles }); } } @@ -22533,37 +24447,37 @@ var $mdgriffith$elm_ui$Internal$Model$nearbyElement = F2( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.av, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.cg])); + [$mdgriffith$elm_ui$Internal$Style$classes.aw, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.cx])); case 1: return A2( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.av, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.cx])); + [$mdgriffith$elm_ui$Internal$Style$classes.aw, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.cN])); case 2: return A2( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.av, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.$7])); + [$mdgriffith$elm_ui$Internal$Style$classes.aw, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.du])); case 3: return A2( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.av, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.dm])); + [$mdgriffith$elm_ui$Internal$Style$classes.aw, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.ds])); case 4: return A2( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.av, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.c8])); + [$mdgriffith$elm_ui$Internal$Style$classes.aw, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.dh])); default: return A2( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.av, $mdgriffith$elm_ui$Internal$Style$classes.dE, $mdgriffith$elm_ui$Internal$Style$classes.cw])); + [$mdgriffith$elm_ui$Internal$Style$classes.aw, $mdgriffith$elm_ui$Internal$Style$classes.dI, $mdgriffith$elm_ui$Internal$Style$classes.cM])); } }()) ]), @@ -22581,7 +24495,7 @@ var $mdgriffith$elm_ui$Internal$Model$nearbyElement = F2( return html($mdgriffith$elm_ui$Internal$Model$asEl); default: var styled = elem.a; - return A2(styled.c5, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, $mdgriffith$elm_ui$Internal$Model$asEl); + return A2(styled.de, $mdgriffith$elm_ui$Internal$Model$NoStyleSheet, $mdgriffith$elm_ui$Internal$Model$asEl); } }() ])); @@ -22664,21 +24578,21 @@ var $mdgriffith$elm_ui$Internal$Model$addNodeName = F2( var $mdgriffith$elm_ui$Internal$Model$alignXName = function (align) { switch (align) { case 0: - return $mdgriffith$elm_ui$Internal$Style$classes.a5 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bu); + return $mdgriffith$elm_ui$Internal$Style$classes.bg + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bE); case 2: - return $mdgriffith$elm_ui$Internal$Style$classes.a5 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bv); + return $mdgriffith$elm_ui$Internal$Style$classes.bg + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bF); default: - return $mdgriffith$elm_ui$Internal$Style$classes.a5 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.cj); + return $mdgriffith$elm_ui$Internal$Style$classes.bg + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.cA); } }; var $mdgriffith$elm_ui$Internal$Model$alignYName = function (align) { switch (align) { case 0: - return $mdgriffith$elm_ui$Internal$Style$classes.a6 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.cp); + return $mdgriffith$elm_ui$Internal$Style$classes.bh + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.cG); case 2: - return $mdgriffith$elm_ui$Internal$Style$classes.a6 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.ci); + return $mdgriffith$elm_ui$Internal$Style$classes.bh + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.cz); default: - return $mdgriffith$elm_ui$Internal$Style$classes.a6 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.ck); + return $mdgriffith$elm_ui$Internal$Style$classes.bh + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.cB); } }; var $elm$virtual_dom$VirtualDom$attribute = F2( @@ -22837,7 +24751,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderHeight = function (h) { var name = 'height-px-' + val; return _Utils_Tuple3( $mdgriffith$elm_ui$Internal$Flag$none, - $mdgriffith$elm_ui$Internal$Style$classes.bG + (' ' + name), + $mdgriffith$elm_ui$Internal$Style$classes.bT + (' ' + name), _List_fromArray( [ A3($mdgriffith$elm_ui$Internal$Model$Single, name, 'height', val + 'px') @@ -22845,21 +24759,21 @@ var $mdgriffith$elm_ui$Internal$Model$renderHeight = function (h) { case 1: return _Utils_Tuple3( A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$heightContent, $mdgriffith$elm_ui$Internal$Flag$none), - $mdgriffith$elm_ui$Internal$Style$classes.bc, + $mdgriffith$elm_ui$Internal$Style$classes.bm, _List_Nil); case 2: var portion = h.a; return (portion === 1) ? _Utils_Tuple3( A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$heightFill, $mdgriffith$elm_ui$Internal$Flag$none), - $mdgriffith$elm_ui$Internal$Style$classes.bd, + $mdgriffith$elm_ui$Internal$Style$classes.bn, _List_Nil) : _Utils_Tuple3( A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$heightFill, $mdgriffith$elm_ui$Internal$Flag$none), - $mdgriffith$elm_ui$Internal$Style$classes.bH + (' height-fill-' + $elm$core$String$fromInt(portion)), + $mdgriffith$elm_ui$Internal$Style$classes.bU + (' height-fill-' + $elm$core$String$fromInt(portion)), _List_fromArray( [ A3( $mdgriffith$elm_ui$Internal$Model$Single, - $mdgriffith$elm_ui$Internal$Style$classes.cr + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.L + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( + $mdgriffith$elm_ui$Internal$Style$classes.cI + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.L + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( 'height-fill-' + $elm$core$String$fromInt(portion))))), 'flex-grow', $elm$core$String$fromInt(portion * 100000)) @@ -22907,7 +24821,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderWidth = function (w) { var px = w.a; return _Utils_Tuple3( $mdgriffith$elm_ui$Internal$Flag$none, - $mdgriffith$elm_ui$Internal$Style$classes.cd + (' width-px-' + $elm$core$String$fromInt(px)), + $mdgriffith$elm_ui$Internal$Style$classes.cu + (' width-px-' + $elm$core$String$fromInt(px)), _List_fromArray( [ A3( @@ -22919,21 +24833,21 @@ var $mdgriffith$elm_ui$Internal$Model$renderWidth = function (w) { case 1: return _Utils_Tuple3( A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$widthContent, $mdgriffith$elm_ui$Internal$Flag$none), - $mdgriffith$elm_ui$Internal$Style$classes.bq, + $mdgriffith$elm_ui$Internal$Style$classes.bA, _List_Nil); case 2: var portion = w.a; return (portion === 1) ? _Utils_Tuple3( A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$widthFill, $mdgriffith$elm_ui$Internal$Flag$none), - $mdgriffith$elm_ui$Internal$Style$classes.br, + $mdgriffith$elm_ui$Internal$Style$classes.bB, _List_Nil) : _Utils_Tuple3( A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$widthFill, $mdgriffith$elm_ui$Internal$Flag$none), - $mdgriffith$elm_ui$Internal$Style$classes.ce + (' width-fill-' + $elm$core$String$fromInt(portion)), + $mdgriffith$elm_ui$Internal$Style$classes.cv + (' width-fill-' + $elm$core$String$fromInt(portion)), _List_fromArray( [ A3( $mdgriffith$elm_ui$Internal$Model$Single, - $mdgriffith$elm_ui$Internal$Style$classes.cr + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.A + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( + $mdgriffith$elm_ui$Internal$Style$classes.cI + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.B + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( 'width-fill-' + $elm$core$String$fromInt(portion))))), 'flex-grow', $elm$core$String$fromInt(portion * 100000)) @@ -23030,26 +24944,26 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( var _v1 = $mdgriffith$elm_ui$Internal$Model$transformClass(transform); if (_v1.$ === 1) { return { - X: A2( + V: A2( $elm$core$List$cons, $elm$html$Html$Attributes$class(classes), attrs), - Z: children, - ae: has, - af: node, - dN: styles + X: children, + ab: has, + ac: node, + dR: styles }; } else { var _class = _v1.a; return { - X: A2( + V: A2( $elm$core$List$cons, $elm$html$Html$Attributes$class(classes + (' ' + _class)), attrs), - Z: children, - ae: has, - af: node, - dN: A2( + X: children, + ab: has, + ac: node, + dR: A2( $elm$core$List$cons, $mdgriffith$elm_ui$Internal$Model$Transform(transform), styles) @@ -23240,7 +25154,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( switch (width.$) { case 0: var px = width.a; - var $temp$classes = ($mdgriffith$elm_ui$Internal$Style$classes.cd + (' width-px-' + $elm$core$String$fromInt(px))) + (' ' + classes), + var $temp$classes = ($mdgriffith$elm_ui$Internal$Style$classes.cu + (' width-px-' + $elm$core$String$fromInt(px))) + (' ' + classes), $temp$node = node, $temp$has = A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$width, has), $temp$transform = transform, @@ -23265,7 +25179,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( elementAttrs = $temp$elementAttrs; continue gatherAttrRecursive; case 1: - var $temp$classes = classes + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bq), + var $temp$classes = classes + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bA), $temp$node = node, $temp$has = A2( $mdgriffith$elm_ui$Internal$Flag$add, @@ -23288,7 +25202,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( case 2: var portion = width.a; if (portion === 1) { - var $temp$classes = classes + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.br), + var $temp$classes = classes + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.bB), $temp$node = node, $temp$has = A2( $mdgriffith$elm_ui$Internal$Flag$add, @@ -23309,7 +25223,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( elementAttrs = $temp$elementAttrs; continue gatherAttrRecursive; } else { - var $temp$classes = classes + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.ce + (' width-fill-' + $elm$core$String$fromInt(portion)))), + var $temp$classes = classes + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.cv + (' width-fill-' + $elm$core$String$fromInt(portion)))), $temp$node = node, $temp$has = A2( $mdgriffith$elm_ui$Internal$Flag$add, @@ -23320,7 +25234,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( $elm$core$List$cons, A3( $mdgriffith$elm_ui$Internal$Model$Single, - $mdgriffith$elm_ui$Internal$Style$classes.cr + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.A + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( + $mdgriffith$elm_ui$Internal$Style$classes.cI + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.B + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( 'width-fill-' + $elm$core$String$fromInt(portion))))), 'flex-grow', $elm$core$String$fromInt(portion * 100000)), @@ -23391,7 +25305,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( var px = height.a; var val = $elm$core$String$fromInt(px) + 'px'; var name = 'height-px-' + val; - var $temp$classes = $mdgriffith$elm_ui$Internal$Style$classes.bG + (' ' + (name + (' ' + classes))), + var $temp$classes = $mdgriffith$elm_ui$Internal$Style$classes.bT + (' ' + (name + (' ' + classes))), $temp$node = node, $temp$has = A2($mdgriffith$elm_ui$Internal$Flag$add, $mdgriffith$elm_ui$Internal$Flag$height, has), $temp$transform = transform, @@ -23412,7 +25326,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( elementAttrs = $temp$elementAttrs; continue gatherAttrRecursive; case 1: - var $temp$classes = $mdgriffith$elm_ui$Internal$Style$classes.bc + (' ' + classes), + var $temp$classes = $mdgriffith$elm_ui$Internal$Style$classes.bm + (' ' + classes), $temp$node = node, $temp$has = A2( $mdgriffith$elm_ui$Internal$Flag$add, @@ -23435,7 +25349,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( case 2: var portion = height.a; if (portion === 1) { - var $temp$classes = $mdgriffith$elm_ui$Internal$Style$classes.bd + (' ' + classes), + var $temp$classes = $mdgriffith$elm_ui$Internal$Style$classes.bn + (' ' + classes), $temp$node = node, $temp$has = A2( $mdgriffith$elm_ui$Internal$Flag$add, @@ -23456,7 +25370,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( elementAttrs = $temp$elementAttrs; continue gatherAttrRecursive; } else { - var $temp$classes = classes + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.bH + (' height-fill-' + $elm$core$String$fromInt(portion)))), + var $temp$classes = classes + (' ' + ($mdgriffith$elm_ui$Internal$Style$classes.bU + (' height-fill-' + $elm$core$String$fromInt(portion)))), $temp$node = node, $temp$has = A2( $mdgriffith$elm_ui$Internal$Flag$add, @@ -23467,7 +25381,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( $elm$core$List$cons, A3( $mdgriffith$elm_ui$Internal$Model$Single, - $mdgriffith$elm_ui$Internal$Style$classes.cr + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.L + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( + $mdgriffith$elm_ui$Internal$Style$classes.cI + ('.' + ($mdgriffith$elm_ui$Internal$Style$classes.L + (' > ' + $mdgriffith$elm_ui$Internal$Style$dot( 'height-fill-' + $elm$core$String$fromInt(portion))))), 'flex-grow', $elm$core$String$fromInt(portion * 100000)), @@ -23768,7 +25682,7 @@ var $mdgriffith$elm_ui$Internal$Model$gatherAttrRecursive = F8( return styles; default: var styled = elem.a; - return _Utils_ap(styles, styled.dN); + return _Utils_ap(styles, styled.dR); } }(); var $temp$classes = classes, @@ -23934,7 +25848,7 @@ var $mdgriffith$elm_ui$Element$column = F2( $mdgriffith$elm_ui$Internal$Model$div, A2( $elm$core$List$cons, - $mdgriffith$elm_ui$Internal$Model$htmlClass($mdgriffith$elm_ui$Internal$Style$classes.cO + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.aF)), + $mdgriffith$elm_ui$Internal$Model$htmlClass($mdgriffith$elm_ui$Internal$Style$classes.c0 + (' ' + $mdgriffith$elm_ui$Internal$Style$classes.aI)), A2( $elm$core$List$cons, $mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$shrink), @@ -24013,11 +25927,11 @@ var $author$project$Introduction$BasicElmUI$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$BasicElmUI$system.be(dnd)); + $author$project$Introduction$BasicElmUI$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( @@ -24029,7 +25943,7 @@ var $author$project$Introduction$BasicElmUI$ghostView = F2( A2( $elm$core$List$map, $mdgriffith$elm_ui$Element$htmlAttribute, - $author$project$Introduction$BasicElmUI$system.c$(dnd))), + $author$project$Introduction$BasicElmUI$system.bS(dnd))), $mdgriffith$elm_ui$Element$text(item)); } else { return $mdgriffith$elm_ui$Element$none; @@ -24055,9 +25969,9 @@ var $mdgriffith$elm_ui$Element$inFront = function (element) { var $author$project$Introduction$BasicElmUI$itemView = F3( function (dnd, index, item) { var itemId = 'id-' + item; - var _v0 = $author$project$Introduction$BasicElmUI$system.be(dnd); + var _v0 = $author$project$Introduction$BasicElmUI$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $mdgriffith$elm_ui$Element$el, A2( @@ -24071,7 +25985,7 @@ var $author$project$Introduction$BasicElmUI$itemView = F3( A2( $elm$core$List$map, $mdgriffith$elm_ui$Element$htmlAttribute, - A2($author$project$Introduction$BasicElmUI$system.cU, index, itemId)))), + A2($author$project$Introduction$BasicElmUI$system.bM, index, itemId)))), $mdgriffith$elm_ui$Element$text(item)) : A2( $mdgriffith$elm_ui$Element$el, _List_fromArray( @@ -24096,7 +26010,7 @@ var $author$project$Introduction$BasicElmUI$itemView = F3( A2( $elm$core$List$map, $mdgriffith$elm_ui$Element$htmlAttribute, - A2($author$project$Introduction$BasicElmUI$system.cT, index, itemId)))), + A2($author$project$Introduction$BasicElmUI$system.bL, index, itemId)))), $mdgriffith$elm_ui$Element$text(item)); } }); @@ -24111,14 +26025,14 @@ var $mdgriffith$elm_ui$Internal$Model$StaticRootAndDynamic = F2( var $mdgriffith$elm_ui$Internal$Model$AllowHover = 1; var $mdgriffith$elm_ui$Internal$Model$Layout = 0; var $mdgriffith$elm_ui$Internal$Model$focusDefaultStyle = { - ct: $elm$core$Maybe$Nothing, - cA: $elm$core$Maybe$Nothing, - dD: $elm$core$Maybe$Just( + cK: $elm$core$Maybe$Nothing, + cQ: $elm$core$Maybe$Nothing, + dH: $elm$core$Maybe$Just( { - ao: 0, - aV: A4($mdgriffith$elm_ui$Internal$Model$Rgba, 155 / 255, 203 / 255, 1, 1), - bQ: _Utils_Tuple2(0, 0), - aJ: 3 + an: 0, + a_: A4($mdgriffith$elm_ui$Internal$Model$Rgba, 155 / 255, 203 / 255, 1, 1), + b4: _Utils_Tuple2(0, 0), + aO: 3 }) }; var $mdgriffith$elm_ui$Internal$Model$optionsToRecord = function (options) { @@ -24127,36 +26041,36 @@ var $mdgriffith$elm_ui$Internal$Model$optionsToRecord = function (options) { switch (opt.$) { case 0: var hoverable = opt.a; - var _v4 = record.c4; + var _v4 = record.dd; if (_v4.$ === 1) { return _Utils_update( record, { - c4: $elm$core$Maybe$Just(hoverable) + dd: $elm$core$Maybe$Just(hoverable) }); } else { return record; } case 1: var focusStyle = opt.a; - var _v5 = record.cZ; + var _v5 = record.c8; if (_v5.$ === 1) { return _Utils_update( record, { - cZ: $elm$core$Maybe$Just(focusStyle) + c8: $elm$core$Maybe$Just(focusStyle) }); } else { return record; } default: var renderMode = opt.a; - var _v6 = record.di; + var _v6 = record.dq; if (_v6.$ === 1) { return _Utils_update( record, { - di: $elm$core$Maybe$Just(renderMode) + dq: $elm$core$Maybe$Just(renderMode) }); } else { return record; @@ -24165,8 +26079,8 @@ var $mdgriffith$elm_ui$Internal$Model$optionsToRecord = function (options) { }); var andFinally = function (record) { return { - cZ: function () { - var _v0 = record.cZ; + c8: function () { + var _v0 = record.c8; if (_v0.$ === 1) { return $mdgriffith$elm_ui$Internal$Model$focusDefaultStyle; } else { @@ -24174,8 +26088,8 @@ var $mdgriffith$elm_ui$Internal$Model$optionsToRecord = function (options) { return focusable; } }(), - c4: function () { - var _v1 = record.c4; + dd: function () { + var _v1 = record.dd; if (_v1.$ === 1) { return 1; } else { @@ -24183,8 +26097,8 @@ var $mdgriffith$elm_ui$Internal$Model$optionsToRecord = function (options) { return hoverable; } }(), - di: function () { - var _v2 = record.di; + dq: function () { + var _v2 = record.dq; if (_v2.$ === 1) { return 0; } else { @@ -24198,7 +26112,7 @@ var $mdgriffith$elm_ui$Internal$Model$optionsToRecord = function (options) { A3( $elm$core$List$foldr, combine, - {cZ: $elm$core$Maybe$Nothing, c4: $elm$core$Maybe$Nothing, di: $elm$core$Maybe$Nothing}, + {c8: $elm$core$Maybe$Nothing, dd: $elm$core$Maybe$Nothing, dq: $elm$core$Maybe$Nothing}, options)); }; var $mdgriffith$elm_ui$Internal$Model$toHtml = F2( @@ -24208,8 +26122,8 @@ var $mdgriffith$elm_ui$Internal$Model$toHtml = F2( var html = el.a; return html($mdgriffith$elm_ui$Internal$Model$asEl); case 1: - var styles = el.a.dN; - var html = el.a.c5; + var styles = el.a.dR; + var html = el.a.de; return A2( html, mode(styles), @@ -24225,7 +26139,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderRoot = F3( function (optionList, attributes, child) { var options = $mdgriffith$elm_ui$Internal$Model$optionsToRecord(optionList); var embedStyle = function () { - var _v0 = options.di; + var _v0 = options.dq; if (_v0 === 1) { return $mdgriffith$elm_ui$Internal$Model$OnlyDynamic(options); } else { @@ -24288,7 +26202,7 @@ var $mdgriffith$elm_ui$Internal$Model$renderFontClassName = F2( $elm$core$String$words( $elm$core$String$toLower(name))); default: - var name = font.a.dl; + var name = font.a.dr; return A2( $elm$core$String$join, '-', @@ -24340,7 +26254,7 @@ var $mdgriffith$elm_ui$Internal$Model$rootStyle = function () { }(); var $mdgriffith$elm_ui$Element$layoutWith = F3( function (_v0, attrs, child) { - var options = _v0.bR; + var options = _v0.b5; return A3( $mdgriffith$elm_ui$Internal$Model$renderRoot, options, @@ -24351,12 +26265,12 @@ var $mdgriffith$elm_ui$Element$layoutWith = F3( $elm$core$String$join, ' ', _List_fromArray( - [$mdgriffith$elm_ui$Internal$Style$classes.dw, $mdgriffith$elm_ui$Internal$Style$classes.cr, $mdgriffith$elm_ui$Internal$Style$classes.dE]))), + [$mdgriffith$elm_ui$Internal$Style$classes.dB, $mdgriffith$elm_ui$Internal$Style$classes.cI, $mdgriffith$elm_ui$Internal$Style$classes.dI]))), _Utils_ap($mdgriffith$elm_ui$Internal$Model$rootStyle, attrs)), child); }); var $mdgriffith$elm_ui$Element$layout = $mdgriffith$elm_ui$Element$layoutWith( - {bR: _List_Nil}); + {b5: _List_Nil}); var $mdgriffith$elm_ui$Internal$Model$PaddingStyle = F5( function (a, b, c, d, e) { return {$: 7, a: a, b: b, c: c, d: d, e: e}; @@ -24406,7 +26320,7 @@ var $author$project$Introduction$BasicElmUI$view = function (model) { $mdgriffith$elm_ui$Element$width($mdgriffith$elm_ui$Element$fill), $mdgriffith$elm_ui$Element$height($mdgriffith$elm_ui$Element$fill), $mdgriffith$elm_ui$Element$inFront( - A2($author$project$Introduction$BasicElmUI$ghostView, model.aa, model.au)) + A2($author$project$Introduction$BasicElmUI$ghostView, model.Z, model.av)) ]), A2( $mdgriffith$elm_ui$Element$column, @@ -24419,8 +26333,8 @@ var $author$project$Introduction$BasicElmUI$view = function (model) { ]), A2( $elm$core$List$indexedMap, - $author$project$Introduction$BasicElmUI$itemView(model.aa), - model.au))) + $author$project$Introduction$BasicElmUI$itemView(model.Z), + model.av))) ])); }; var $author$project$Introduction$Groups$itemStyles = function (color) { @@ -24443,23 +26357,23 @@ var $author$project$Introduction$Groups$maybeDragItem = F2( return A2( $elm$core$Maybe$andThen, function (_v0) { - var dragIndex = _v0.a9; + var dragIndex = _v0.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Groups$system.be(dnd)); + $author$project$Introduction$Groups$system.bX(dnd)); }); var $author$project$Introduction$Groups$ghostView = F2( function (dnd, items) { var _v0 = A2($author$project$Introduction$Groups$maybeDragItem, dnd, items); if (!_v0.$) { - var value = _v0.a.aB; - var color = _v0.a.aV; + var value = _v0.a.aC; + var color = _v0.a.a_; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Groups$itemStyles(color), - $author$project$Introduction$Groups$system.c$(dnd)), + $author$project$Introduction$Groups$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(value) @@ -24477,7 +26391,7 @@ var $author$project$Introduction$Groups$calculateOffset = F3( } else { var x = list.a; var xs = list.b; - if (_Utils_eq(x.t, group)) { + if (_Utils_eq(x.x, group)) { return index; } else { var $temp$index = index + 1, @@ -24511,26 +26425,26 @@ var $author$project$Introduction$Groups$auxiliaryStyles = _List_fromArray( var $author$project$Introduction$Groups$gray = 'dimgray'; var $author$project$Introduction$Groups$itemView = F4( function (model, offset, localIndex, _v0) { - var group = _v0.t; - var value = _v0.aB; - var color = _v0.aV; + var group = _v0.x; + var value = _v0.aC; + var color = _v0.a_; var globalIndex = offset + localIndex; var itemId = 'id-' + $elm$core$String$fromInt(globalIndex); var _v1 = _Utils_Tuple2( - $author$project$Introduction$Groups$system.be(model.aa), - A2($author$project$Introduction$Groups$maybeDragItem, model.aa, model.au)); + $author$project$Introduction$Groups$system.bX(model.Z), + A2($author$project$Introduction$Groups$maybeDragItem, model.Z, model.av)); if ((!_v1.a.$) && (!_v1.b.$)) { - var dragIndex = _v1.a.a.a9; + var dragIndex = _v1.a.a.c; var dragItem = _v1.b.a; - return (_Utils_eq(color, $author$project$Introduction$Groups$transparent) && ((value === 'footer') && (!_Utils_eq(dragItem.t, group)))) ? A2( + return (_Utils_eq(color, $author$project$Introduction$Groups$transparent) && ((value === 'footer') && (!_Utils_eq(dragItem.x, group)))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Groups$auxiliaryStyles, - A2($author$project$Introduction$Groups$system.cU, globalIndex, itemId))), - _List_Nil) : ((_Utils_eq(color, $author$project$Introduction$Groups$transparent) && ((value === 'footer') && _Utils_eq(dragItem.t, group))) ? A2( + A2($author$project$Introduction$Groups$system.bM, globalIndex, itemId))), + _List_Nil) : ((_Utils_eq(color, $author$project$Introduction$Groups$transparent) && ((value === 'footer') && _Utils_eq(dragItem.x, group))) ? A2( $elm$html$Html$div, A2( $elm$core$List$cons, @@ -24543,7 +26457,7 @@ var $author$project$Introduction$Groups$itemView = F4( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Groups$itemStyles(color), - A2($author$project$Introduction$Groups$system.cU, globalIndex, itemId))), + A2($author$project$Introduction$Groups$system.bM, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -24568,7 +26482,7 @@ var $author$project$Introduction$Groups$itemView = F4( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Groups$itemStyles(color), - A2($author$project$Introduction$Groups$system.cT, globalIndex, itemId))), + A2($author$project$Introduction$Groups$system.bL, globalIndex, itemId))), _List_fromArray( [ $elm$html$Html$text(value) @@ -24585,13 +26499,13 @@ var $author$project$Introduction$Groups$groupView = F3( A2( $author$project$Introduction$Groups$itemView, model, - A3($author$project$Introduction$Groups$calculateOffset, 0, group, model.au)), + A3($author$project$Introduction$Groups$calculateOffset, 0, group, model.av)), A2( $elm$core$List$filter, function (item) { - return _Utils_eq(item.t, group); + return _Utils_eq(item.x, group); }, - model.au))); + model.av))); }); var $author$project$Introduction$Groups$lightBlue = '#88b0ea'; var $author$project$Introduction$Groups$lightRed = '#ea9088'; @@ -24612,7 +26526,7 @@ var $author$project$Introduction$Groups$view = function (model) { [ A3($author$project$Introduction$Groups$groupView, model, 0, $author$project$Introduction$Groups$lightRed), A3($author$project$Introduction$Groups$groupView, model, 1, $author$project$Introduction$Groups$lightBlue), - A2($author$project$Introduction$Groups$ghostView, model.aa, model.au) + A2($author$project$Introduction$Groups$ghostView, model.Z, model.av) ])); }; var $author$project$Introduction$Handle$containerStyles = _List_fromArray( @@ -24654,18 +26568,18 @@ var $author$project$Introduction$Handle$ghostView = F2( var maybeDragFruit = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, fruits)); }, - $author$project$Introduction$Handle$system.be(dnd)); + $author$project$Introduction$Handle$system.bX(dnd)); if (!maybeDragFruit.$) { var fruit = maybeDragFruit.a; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Handle$itemStyles($author$project$Introduction$Handle$orange), - $author$project$Introduction$Handle$system.c$(dnd)), + $author$project$Introduction$Handle$system.bS(dnd)), _List_fromArray( [ A2( @@ -24683,9 +26597,9 @@ var $author$project$Introduction$Handle$green = '#cddc39'; var $author$project$Introduction$Handle$itemView = F3( function (dnd, index, fruit) { var fruitId = 'id-' + fruit; - var _v0 = $author$project$Introduction$Handle$system.be(dnd); + var _v0 = $author$project$Introduction$Handle$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, A2( @@ -24693,7 +26607,7 @@ var $author$project$Introduction$Handle$itemView = F3( $elm$html$Html$Attributes$id(fruitId), _Utils_ap( $author$project$Introduction$Handle$itemStyles($author$project$Introduction$Handle$green), - A2($author$project$Introduction$Handle$system.cU, index, fruitId))), + A2($author$project$Introduction$Handle$system.bM, index, fruitId))), _List_fromArray( [ A2( @@ -24721,7 +26635,7 @@ var $author$project$Introduction$Handle$itemView = F3( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Handle$handleStyles($author$project$Introduction$Handle$darkGreen), - A2($author$project$Introduction$Handle$system.cT, index, fruitId)), + A2($author$project$Introduction$Handle$system.bL, index, fruitId)), _List_Nil), $elm$html$Html$text(fruit) ])); @@ -24738,9 +26652,9 @@ var $author$project$Introduction$Handle$view = function (model) { $author$project$Introduction$Handle$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Handle$itemView(model.aa), - model.as)), - A2($author$project$Introduction$Handle$ghostView, model.aa, model.as) + $author$project$Introduction$Handle$itemView(model.Z), + model.au)), + A2($author$project$Introduction$Handle$ghostView, model.Z, model.au) ])); }; var $author$project$Introduction$Independents$blueGhost = '#0067c3'; @@ -24764,18 +26678,18 @@ var $author$project$Introduction$Independents$blueGhostView = F2( var maybeDragBlue = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Independents$blueSystem.be(dnd)); + $author$project$Introduction$Independents$blueSystem.bX(dnd)); if (!maybeDragBlue.$) { var item = maybeDragBlue.a; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Independents$itemStyles($author$project$Introduction$Independents$blueGhost), - $author$project$Introduction$Independents$blueSystem.c$(dnd)), + $author$project$Introduction$Independents$blueSystem.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(item) @@ -24789,9 +26703,9 @@ var $author$project$Introduction$Independents$gray = 'dimgray'; var $author$project$Introduction$Independents$blueView = F3( function (dnd, index, item) { var itemId = 'blue-' + item; - var _v0 = $author$project$Introduction$Independents$blueSystem.be(dnd); + var _v0 = $author$project$Introduction$Independents$blueSystem.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, A2( @@ -24799,7 +26713,7 @@ var $author$project$Introduction$Independents$blueView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Independents$itemStyles($author$project$Introduction$Independents$blue), - A2($author$project$Introduction$Independents$blueSystem.cU, index, itemId))), + A2($author$project$Introduction$Independents$blueSystem.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -24818,7 +26732,7 @@ var $author$project$Introduction$Independents$blueView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Independents$itemStyles($author$project$Introduction$Independents$blue), - A2($author$project$Introduction$Independents$blueSystem.cT, index, itemId))), + A2($author$project$Introduction$Independents$blueSystem.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -24837,18 +26751,18 @@ var $author$project$Introduction$Independents$redGhostView = F2( var maybeDragRed = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Independents$redSystem.be(dnd)); + $author$project$Introduction$Independents$redSystem.bX(dnd)); if (!maybeDragRed.$) { var item = maybeDragRed.a; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Independents$itemStyles($author$project$Introduction$Independents$redGhost), - $author$project$Introduction$Independents$redSystem.c$(dnd)), + $author$project$Introduction$Independents$redSystem.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(item) @@ -24861,9 +26775,9 @@ var $author$project$Introduction$Independents$red = '#ff1117'; var $author$project$Introduction$Independents$redView = F3( function (dnd, index, item) { var itemId = 'red-' + item; - var _v0 = $author$project$Introduction$Independents$redSystem.be(dnd); + var _v0 = $author$project$Introduction$Independents$redSystem.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, A2( @@ -24871,7 +26785,7 @@ var $author$project$Introduction$Independents$redView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Independents$itemStyles($author$project$Introduction$Independents$red), - A2($author$project$Introduction$Independents$redSystem.cU, index, itemId))), + A2($author$project$Introduction$Independents$redSystem.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -24890,7 +26804,7 @@ var $author$project$Introduction$Independents$redView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Independents$itemStyles($author$project$Introduction$Independents$red), - A2($author$project$Introduction$Independents$redSystem.cT, index, itemId))), + A2($author$project$Introduction$Independents$redSystem.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -24915,17 +26829,17 @@ var $author$project$Introduction$Independents$view = function (model) { $author$project$Introduction$Independents$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Independents$redView(model.aj), - model.aw)), + $author$project$Introduction$Independents$redView(model.ag), + model.ax)), A2( $elm$html$Html$div, $author$project$Introduction$Independents$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Independents$blueView(model.Y), - model.an)), - A2($author$project$Introduction$Independents$redGhostView, model.aj, model.aw), - A2($author$project$Introduction$Independents$blueGhostView, model.Y, model.an) + $author$project$Introduction$Independents$blueView(model.W), + model.am)), + A2($author$project$Introduction$Independents$redGhostView, model.ag, model.ax), + A2($author$project$Introduction$Independents$blueGhostView, model.W, model.am) ])); }; var $author$project$Introduction$Keyed$containerStyles = _List_fromArray( @@ -24957,11 +26871,11 @@ var $author$project$Introduction$Keyed$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v2) { - var dragIndex = _v2.a9; + var dragIndex = _v2.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Keyed$system.be(dnd)); + $author$project$Introduction$Keyed$system.bX(dnd)); if (!maybeDragItem.$) { var _v1 = maybeDragItem.a; var item = _v1.b; @@ -24969,7 +26883,7 @@ var $author$project$Introduction$Keyed$ghostView = F2( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Keyed$itemStyles($author$project$Introduction$Keyed$ghostGreen), - $author$project$Introduction$Keyed$system.c$(dnd)), + $author$project$Introduction$Keyed$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(item) @@ -24984,9 +26898,9 @@ var $author$project$Introduction$Keyed$itemView = F3( var key = _v0.a; var item = _v0.b; var itemId = 'id-' + item; - var _v1 = $author$project$Introduction$Keyed$system.be(dnd); + var _v1 = $author$project$Introduction$Keyed$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; + var dragIndex = _v1.a.c; return (!_Utils_eq(dragIndex, index)) ? _Utils_Tuple2( key, A2( @@ -24996,7 +26910,7 @@ var $author$project$Introduction$Keyed$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Keyed$itemStyles($author$project$Introduction$Keyed$green), - A2($author$project$Introduction$Keyed$system.cU, index, itemId))), + A2($author$project$Introduction$Keyed$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -25019,7 +26933,7 @@ var $author$project$Introduction$Keyed$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Keyed$itemStyles($author$project$Introduction$Keyed$green), - A2($author$project$Introduction$Keyed$system.cT, index, itemId))), + A2($author$project$Introduction$Keyed$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -25039,9 +26953,9 @@ var $author$project$Introduction$Keyed$view = function (model) { $author$project$Introduction$Keyed$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Keyed$itemView(model.aa), - model.au)), - A2($author$project$Introduction$Keyed$ghostView, model.aa, model.au) + $author$project$Introduction$Keyed$itemView(model.Z), + model.av)), + A2($author$project$Introduction$Keyed$ghostView, model.Z, model.av) ])); }; var $author$project$Introduction$Margins$containerStyles = _List_fromArray( @@ -25071,18 +26985,18 @@ var $author$project$Introduction$Margins$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Margins$system.be(dnd)); + $author$project$Introduction$Margins$system.bX(dnd)); if (!maybeDragItem.$) { var item = maybeDragItem.a; return A2( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Margins$itemStyles($author$project$Introduction$Margins$ghostGreen), - $author$project$Introduction$Margins$system.c$(dnd)), + $author$project$Introduction$Margins$system.bS(dnd)), _List_fromArray( [ $elm$html$Html$text(item) @@ -25095,9 +27009,9 @@ var $author$project$Introduction$Margins$green = '#3da565'; var $author$project$Introduction$Margins$itemView = F3( function (dnd, index, item) { var itemId = 'id-' + item; - var _v0 = $author$project$Introduction$Margins$system.be(dnd); + var _v0 = $author$project$Introduction$Margins$system.bX(dnd); if (!_v0.$) { - var dragIndex = _v0.a.a9; + var dragIndex = _v0.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, _List_fromArray( @@ -25113,7 +27027,7 @@ var $author$project$Introduction$Margins$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Margins$itemStyles($author$project$Introduction$Margins$green), - A2($author$project$Introduction$Margins$system.cU, index, itemId))), + A2($author$project$Introduction$Margins$system.bM, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -25150,7 +27064,7 @@ var $author$project$Introduction$Margins$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( $author$project$Introduction$Margins$itemStyles($author$project$Introduction$Margins$green), - A2($author$project$Introduction$Margins$system.cT, index, itemId))), + A2($author$project$Introduction$Margins$system.bL, index, itemId))), _List_fromArray( [ $elm$html$Html$text(item) @@ -25169,9 +27083,9 @@ var $author$project$Introduction$Margins$view = function (model) { $author$project$Introduction$Margins$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Margins$itemView(model.aa), - model.au)), - A2($author$project$Introduction$Margins$ghostView, model.aa, model.au) + $author$project$Introduction$Margins$itemView(model.Z), + model.av)), + A2($author$project$Introduction$Margins$ghostView, model.Z, model.av) ])); }; var $author$project$Introduction$Masonry$containerStyles = _List_fromArray( @@ -25202,11 +27116,11 @@ var $author$project$Introduction$Masonry$ghostView = F2( var maybeDragItem = A2( $elm$core$Maybe$andThen, function (_v2) { - var dragIndex = _v2.a9; + var dragIndex = _v2.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, items)); }, - $author$project$Introduction$Masonry$system.be(dnd)); + $author$project$Introduction$Masonry$system.bX(dnd)); if (!maybeDragItem.$) { var _v1 = maybeDragItem.a; var color = _v1.a; @@ -25215,7 +27129,7 @@ var $author$project$Introduction$Masonry$ghostView = F2( $elm$html$Html$div, _Utils_ap( A2($author$project$Introduction$Masonry$itemStyles, color, width), - $author$project$Introduction$Masonry$system.c$(dnd)), + $author$project$Introduction$Masonry$system.bS(dnd)), _List_Nil); } else { return $elm$html$Html$text(''); @@ -25226,9 +27140,9 @@ var $author$project$Introduction$Masonry$itemView = F3( var color = _v0.a; var width = _v0.b; var itemId = 'id-' + color; - var _v1 = $author$project$Introduction$Masonry$system.be(dnd); + var _v1 = $author$project$Introduction$Masonry$system.bX(dnd); if (!_v1.$) { - var dragIndex = _v1.a.a9; + var dragIndex = _v1.a.c; return (!_Utils_eq(dragIndex, index)) ? A2( $elm$html$Html$div, A2( @@ -25236,7 +27150,7 @@ var $author$project$Introduction$Masonry$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( A2($author$project$Introduction$Masonry$itemStyles, color, width), - A2($author$project$Introduction$Masonry$system.cU, index, itemId))), + A2($author$project$Introduction$Masonry$system.bM, index, itemId))), _List_Nil) : A2( $elm$html$Html$div, A2( @@ -25252,7 +27166,7 @@ var $author$project$Introduction$Masonry$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( A2($author$project$Introduction$Masonry$itemStyles, color, width), - A2($author$project$Introduction$Masonry$system.cT, index, itemId))), + A2($author$project$Introduction$Masonry$system.bL, index, itemId))), _List_Nil); } }); @@ -25267,9 +27181,9 @@ var $author$project$Introduction$Masonry$view = function (model) { $author$project$Introduction$Masonry$containerStyles, A2( $elm$core$List$indexedMap, - $author$project$Introduction$Masonry$itemView(model.aa), - model.au)), - A2($author$project$Introduction$Masonry$ghostView, model.aa, model.au) + $author$project$Introduction$Masonry$itemView(model.Z), + model.av)), + A2($author$project$Introduction$Masonry$ghostView, model.Z, model.av) ])); }; var $author$project$Introduction$Resize$containerStyles = _List_fromArray( @@ -25311,32 +27225,32 @@ var $author$project$Introduction$Resize$itemStyles = F3( ]); }); var $author$project$Introduction$Resize$maybeDragItem = function (_v0) { - var dnd = _v0.aa; - var colors = _v0.ap; + var dnd = _v0.Z; + var colors = _v0.ao; return A2( $elm$core$Maybe$andThen, function (_v1) { - var dragIndex = _v1.a9; + var dragIndex = _v1.c; return $elm$core$List$head( A2($elm$core$List$drop, dragIndex, colors)); }, - $author$project$Introduction$Resize$system.be(dnd)); + $author$project$Introduction$Resize$system.bX(dnd)); }; var $author$project$Introduction$Resize$ghostView = function (model) { var _v0 = _Utils_Tuple2( - $author$project$Introduction$Resize$system.be(model.aa), + $author$project$Introduction$Resize$system.bX(model.Z), $author$project$Introduction$Resize$maybeDragItem(model)); if ((!_v0.a.$) && (!_v0.b.$)) { - var dropElement = _v0.a.a.ab; + var dropElement = _v0.a.a._; var color = _v0.b.a; - var width = $elm$core$Basics$round(dropElement.cW.d4); - var height = $elm$core$Basics$round(dropElement.cW.c2); + var width = $elm$core$Basics$round(dropElement.c5.aW); + var height = $elm$core$Basics$round(dropElement.c5.db); return A2( $elm$html$Html$div, _Utils_ap( A3($author$project$Introduction$Resize$itemStyles, width, height, color), _Utils_ap( - $author$project$Introduction$Resize$system.c$(model.aa), + $author$project$Introduction$Resize$system.bS(model.Z), _List_fromArray( [ A2( @@ -25368,12 +27282,12 @@ var $author$project$Introduction$Resize$itemView = F3( function (model, index, _v0) { var color = _v0.a; var spot = _v0.b; - var width = spot.d4 * 5; + var width = spot.aW * 5; var itemId = 'id-' + $elm$core$String$fromInt(index); - var height = spot.c2 * 5; - var _v1 = $author$project$Introduction$Resize$system.be(model.aa); + var height = spot.db * 5; + var _v1 = $author$project$Introduction$Resize$system.bX(model.Z); if (!_v1.$) { - var dragIndex = _v1.a.a9; + var dragIndex = _v1.a.c; return (!_Utils_eq(index, dragIndex)) ? A2( $elm$html$Html$div, A2( @@ -25381,7 +27295,7 @@ var $author$project$Introduction$Resize$itemView = F3( $elm$html$Html$Attributes$id(itemId), _Utils_ap( A3($author$project$Introduction$Resize$itemStyles, width, height, color), - A2($author$project$Introduction$Resize$system.cU, index, itemId))), + A2($author$project$Introduction$Resize$system.bM, index, itemId))), _List_fromArray( [ A2( @@ -25411,7 +27325,7 @@ var $author$project$Introduction$Resize$itemView = F3( $elm$html$Html$div, _Utils_ap( $author$project$Introduction$Resize$handleStyles, - A2($author$project$Introduction$Resize$system.cT, index, itemId)), + A2($author$project$Introduction$Resize$system.bL, index, itemId)), _List_fromArray( [ $elm$html$Html$text('⠶') @@ -25421,7 +27335,7 @@ var $author$project$Introduction$Resize$itemView = F3( }); var $author$project$Introduction$Resize$Spot = F2( function (width, height) { - return {c2: height, d4: width}; + return {db: height, aW: width}; }); var $author$project$Introduction$Resize$spots = _List_fromArray( [ @@ -25449,92 +27363,94 @@ var $author$project$Introduction$Resize$view = function (model) { function (color, spot) { return _Utils_Tuple2(color, spot); }), - model.ap, + model.ao, $author$project$Introduction$Resize$spots))), $author$project$Introduction$Resize$ghostView(model) ])); }; -var $author$project$Introduction$Root$demoView = function (model) { +var $author$project$Introduction$Parent$demoView = function (model) { switch (model.$) { case 0: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$BasicMsg, + $author$project$Introduction$Parent$BasicMsg, $author$project$Introduction$Basic$view(mo)); case 1: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$BasicElmUIMsg, + $author$project$Introduction$Parent$BasicElmUIMsg, $author$project$Introduction$BasicElmUI$view(mo)); case 2: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$HandleMsg, + $author$project$Introduction$Parent$HandleMsg, $author$project$Introduction$Handle$view(mo)); case 3: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$KeyedMsg, + $author$project$Introduction$Parent$KeyedMsg, $author$project$Introduction$Keyed$view(mo)); case 4: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$MarginsMsg, + $author$project$Introduction$Parent$MarginsMsg, $author$project$Introduction$Margins$view(mo)); case 5: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$MasonryMsg, + $author$project$Introduction$Parent$MasonryMsg, $author$project$Introduction$Masonry$view(mo)); case 6: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$ResizeMsg, + $author$project$Introduction$Parent$ResizeMsg, $author$project$Introduction$Resize$view(mo)); case 7: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$IndependentsMsg, + $author$project$Introduction$Parent$IndependentsMsg, $author$project$Introduction$Independents$view(mo)); default: var mo = model.a; return A2( $elm$html$Html$map, - $author$project$Introduction$Root$GroupsMsg, + $author$project$Introduction$Parent$GroupsMsg, $author$project$Introduction$Groups$view(mo)); } }; var $elm$html$Html$h2 = _VirtualDom_node('h2'); -var $author$project$Config$Root$info = function (example) { +var $author$project$DnDList$Parent$info = function (example) { switch (example.$) { case 0: - return {aG: 'The behavior of the Free, Horizontal only and Vertical only drag movements with Swap list operation.', aK: 'movement', aA: 'Movement'}; + return {ap: 'The behavior of the Free, Horizontal only and Vertical only drag movements with Swap list operation.', az: 'movement', ai: 'Movement'}; case 1: - return {aG: 'Compare the list operations sorting on drag.', aK: 'operations-drag', aA: 'Operations on drag'}; + return {ap: 'Compare the list operations sorting on drag.', az: 'operations-drag', ai: 'Operations on drag'}; + case 2: + return {ap: 'Compare the list operations sorting on drop.', az: 'operations-drop', ai: 'Operations on drop'}; default: - return {aG: 'Compare the list operations sorting on drop.', aK: 'operations-drop', aA: 'Operations on drop'}; + return {ap: 'Compare detectDrop and detectReorder hooks.', az: 'hook-commands', ai: 'Hook commands'}; } }; -var $author$project$Config$Root$headerView = function (model) { +var $author$project$DnDList$Parent$headerView = function (model) { var title = A2( $elm$core$Basics$composeR, - $author$project$Config$Root$info, + $author$project$DnDList$Parent$info, function ($) { - return $.aA; + return $.ai; })(model); var description = A2( $elm$core$Basics$composeR, - $author$project$Config$Root$info, + $author$project$DnDList$Parent$info, function ($) { - return $.aG; + return $.ap; })(model); return A2( $elm$html$Html$header, @@ -25557,25 +27473,28 @@ var $author$project$Config$Root$headerView = function (model) { ])) ])); }; -var $author$project$ConfigGroups$Root$info = function (example) { - if (!example.$) { - return {aG: 'Compare the list operations with groups sorting on drag.', aK: 'operations-drag', aA: 'Operations on drag'}; - } else { - return {aG: 'Compare the list operations with groups sorting on drop.', aK: 'operations-drop', aA: 'Operations on drop'}; +var $author$project$DnDListGroups$Parent$info = function (example) { + switch (example.$) { + case 0: + return {ap: 'Compare the list operations with groups sorting on drag.', az: 'operations-drag', ai: 'Operations on drag'}; + case 1: + return {ap: 'Compare the list operations with groups sorting on drop.', az: 'operations-drop', ai: 'Operations on drop'}; + default: + return {ap: 'Compare detectDrop and detectReorder hooks.', az: 'hook-commands', ai: 'Hook commands'}; } }; -var $author$project$ConfigGroups$Root$headerView = function (model) { +var $author$project$DnDListGroups$Parent$headerView = function (model) { var title = A2( $elm$core$Basics$composeR, - $author$project$ConfigGroups$Root$info, + $author$project$DnDListGroups$Parent$info, function ($) { - return $.aA; + return $.ai; })(model); var description = A2( $elm$core$Basics$composeR, - $author$project$ConfigGroups$Root$info, + $author$project$DnDListGroups$Parent$info, function ($) { - return $.aG; + return $.ap; })(model); return A2( $elm$html$Html$header, @@ -25598,34 +27517,34 @@ var $author$project$ConfigGroups$Root$headerView = function (model) { ])) ])); }; -var $author$project$Gallery$Root$info = function (example) { +var $author$project$Gallery$Parent$info = function (example) { switch (example.$) { case 0: - return {aG: 'Flat list with auxiliary items.', aK: 'hanoi', aA: 'Towers of Hanoi'}; + return {ap: 'Flat list with auxiliary items.', az: 'hanoi', ai: 'Towers of Hanoi'}; case 1: - return {aG: 'List with groups without auxiliary items.', aK: 'puzzle', aA: 'Puzzle'}; + return {ap: 'List with groups without auxiliary items.', az: 'puzzle', ai: 'Puzzle'}; case 2: - return {aG: 'Flat list with the Unaltered operation and beforeUpdate.', aK: 'shapes', aA: 'Geometric shapes'}; + return {ap: 'Flat list with the Unaltered operation and beforeUpdate.', az: 'shapes', ai: 'Geometric shapes'}; case 3: - return {aG: 'Flat list with Swap. The top-left 5 × 5 sub-board is diced from the original 8 × 8 board.', aK: 'knight', aA: 'Knight\'s tour'}; + return {ap: 'Flat list with Swap. The top-left 5 × 5 sub-board is diced from the original 8 × 8 board.', az: 'knight', ai: 'Knight\'s tour'}; case 4: - return {aG: 'Flat list with info.targetElement.', aK: 'try-on', aA: 'Try on'}; + return {ap: 'Flat list with info.targetElement.', az: 'try-on', ai: 'Try on'}; default: - return {aG: 'Two systems - one for the cards and one for the columns.', aK: 'taskboard', aA: 'Task board'}; + return {ap: 'Two systems - one for the cards and one for the columns.', az: 'taskboard', ai: 'Task board'}; } }; -var $author$project$Gallery$Root$headerView = function (model) { +var $author$project$Gallery$Parent$headerView = function (model) { var title = A2( $elm$core$Basics$composeR, - $author$project$Gallery$Root$info, + $author$project$Gallery$Parent$info, function ($) { - return $.aA; + return $.ai; })(model); var description = A2( $elm$core$Basics$composeR, - $author$project$Gallery$Root$info, + $author$project$Gallery$Parent$info, function ($) { - return $.aG; + return $.ap; })(model); return A2( $elm$html$Html$header, @@ -25648,40 +27567,40 @@ var $author$project$Gallery$Root$headerView = function (model) { ])) ])); }; -var $author$project$Introduction$Root$info = function (example) { +var $author$project$Introduction$Parent$info = function (example) { switch (example.$) { case 0: - return {aG: 'Plain sortable list', aK: 'basic', aA: 'Basic'}; + return {ap: 'Plain sortable list', az: 'basic', ai: 'Basic'}; case 1: - return {aG: 'Designed with mdgriffith/elm-ui', aK: 'basic-elm-ui', aA: 'Basic + Elm UI'}; + return {ap: 'Designed with mdgriffith/elm-ui', az: 'basic-elm-ui', ai: 'Basic + Elm UI'}; case 2: - return {aG: 'Use a subelement as a drag handle.', aK: 'handle', aA: 'Drag handle'}; + return {ap: 'Use a subelement as a drag handle.', az: 'handle', ai: 'Drag handle'}; case 3: - return {aG: 'Use Html.Keyed for optimized DOM updates.', aK: 'keyed', aA: 'Keyed nodes'}; + return {ap: 'Use Html.Keyed for optimized DOM updates.', az: 'keyed', ai: 'Keyed nodes'}; case 4: - return {aG: 'Wrap elements in case top or left margins are needed.', aK: 'margins', aA: 'Margins'}; + return {ap: 'Wrap elements in case top or left margins are needed.', az: 'margins', ai: 'Margins'}; case 5: - return {aG: 'Simple horizontal masonry.', aK: 'masonry', aA: 'Masonry'}; + return {ap: 'Simple horizontal masonry.', az: 'masonry', ai: 'Masonry'}; case 6: - return {aG: 'Put a drag handle to the top-left corner with resizable ghost element.', aK: 'resize', aA: 'Resize'}; + return {ap: 'Put a drag handle to the top-left corner with resizable ghost element.', az: 'resize', ai: 'Resize'}; case 7: - return {aG: 'Without thinking: duplicate everything.', aK: 'independents', aA: 'Independent lists'}; + return {ap: 'Without thinking: duplicate everything.', az: 'independents', ai: 'Independent lists'}; default: - return {aG: 'The list state invariant is that the list is gathered by the grouping property, and the auxiliary items preserve their places.', aK: 'groups', aA: 'Groupable items'}; + return {ap: 'The list state invariant is that the list is gathered by the grouping property, and the auxiliary items preserve their places.', az: 'groups', ai: 'Groupable items'}; } }; -var $author$project$Introduction$Root$headerView = function (model) { +var $author$project$Introduction$Parent$headerView = function (model) { var title = A2( $elm$core$Basics$composeR, - $author$project$Introduction$Root$info, + $author$project$Introduction$Parent$info, function ($) { - return $.aA; + return $.ai; })(model); var description = A2( $elm$core$Basics$composeR, - $author$project$Introduction$Root$info, + $author$project$Introduction$Parent$info, function ($) { - return $.aG; + return $.ap; })(model); return A2( $elm$html$Html$header, @@ -25707,20 +27626,19 @@ var $author$project$Introduction$Root$headerView = function (model) { var $elm$html$Html$main_ = _VirtualDom_node('main'); var $elm$html$Html$nav = _VirtualDom_node('nav'); var $elm$html$Html$h4 = _VirtualDom_node('h4'); -var $elm$html$Html$li = _VirtualDom_node('li'); -var $author$project$Config$Root$linkView = F2( +var $author$project$DnDList$Parent$linkView = F2( function (currentPath, example) { var path = A2( $elm$url$Url$Builder$absolute, _List_fromArray( [ $author$project$Path$rootPath, - 'config', + 'DnDList', A2( $elm$core$Basics$composeR, - $author$project$Config$Root$info, + $author$project$DnDList$Parent$info, function ($) { - return $.aK; + return $.az; })(example) ]), _List_Nil); @@ -25747,15 +27665,14 @@ var $author$project$Config$Root$linkView = F2( $elm$html$Html$text( A2( $elm$core$Basics$composeR, - $author$project$Config$Root$info, + $author$project$DnDList$Parent$info, function ($) { - return $.aA; + return $.ai; })(example)) ])) ])); }); -var $elm$html$Html$ul = _VirtualDom_node('ul'); -var $author$project$Config$Root$navigationView = function (currentPath) { +var $author$project$DnDList$Parent$navigationView = function (currentPath) { return A2( $elm$html$Html$div, _List_fromArray( @@ -25776,28 +27693,29 @@ var $author$project$Config$Root$navigationView = function (currentPath) { _List_Nil, A2( $elm$core$List$map, - $author$project$Config$Root$linkView(currentPath), + $author$project$DnDList$Parent$linkView(currentPath), _List_fromArray( [ - $author$project$Config$Root$Movement($author$project$Config$Movement$Root$initialModel), - $author$project$Config$Root$OperationsOnDrag($author$project$Config$OperationsOnDrag$Root$initialModel), - $author$project$Config$Root$OperationsOnDrop($author$project$Config$OperationsOnDrop$Root$initialModel) + $author$project$DnDList$Parent$Movement($author$project$DnDList$Movement$Parent$initialModel), + $author$project$DnDList$Parent$OperationsOnDrag($author$project$DnDList$OperationsOnDrag$Parent$initialModel), + $author$project$DnDList$Parent$OperationsOnDrop($author$project$DnDList$OperationsOnDrop$Parent$initialModel), + $author$project$DnDList$Parent$HookCommands($author$project$DnDList$HookCommands$Parent$initialModel) ]))) ])); }; -var $author$project$ConfigGroups$Root$linkView = F2( +var $author$project$DnDListGroups$Parent$linkView = F2( function (currentPath, example) { var path = A2( $elm$url$Url$Builder$absolute, _List_fromArray( [ $author$project$Path$rootPath, - 'config-groups', + 'DnDListGroups', A2( $elm$core$Basics$composeR, - $author$project$ConfigGroups$Root$info, + $author$project$DnDListGroups$Parent$info, function ($) { - return $.aK; + return $.az; })(example) ]), _List_Nil); @@ -25824,14 +27742,14 @@ var $author$project$ConfigGroups$Root$linkView = F2( $elm$html$Html$text( A2( $elm$core$Basics$composeR, - $author$project$ConfigGroups$Root$info, + $author$project$DnDListGroups$Parent$info, function ($) { - return $.aA; + return $.ai; })(example)) ])) ])); }); -var $author$project$ConfigGroups$Root$navigationView = function (currentPath) { +var $author$project$DnDListGroups$Parent$navigationView = function (currentPath) { return A2( $elm$html$Html$div, _List_fromArray( @@ -25852,15 +27770,16 @@ var $author$project$ConfigGroups$Root$navigationView = function (currentPath) { _List_Nil, A2( $elm$core$List$map, - $author$project$ConfigGroups$Root$linkView(currentPath), + $author$project$DnDListGroups$Parent$linkView(currentPath), _List_fromArray( [ - $author$project$ConfigGroups$Root$OperationsOnDrag($author$project$ConfigGroups$OperationsOnDrag$Root$initialModel), - $author$project$ConfigGroups$Root$OperationsOnDrop($author$project$ConfigGroups$OperationsOnDrop$Root$initialModel) + $author$project$DnDListGroups$Parent$OperationsOnDrag($author$project$DnDListGroups$OperationsOnDrag$Parent$initialModel), + $author$project$DnDListGroups$Parent$OperationsOnDrop($author$project$DnDListGroups$OperationsOnDrop$Parent$initialModel), + $author$project$DnDListGroups$Parent$HookCommands($author$project$DnDListGroups$HookCommands$Parent$initialModel) ]))) ])); }; -var $author$project$Gallery$Root$linkView = F2( +var $author$project$Gallery$Parent$linkView = F2( function (currentPath, example) { var path = A2( $elm$url$Url$Builder$absolute, @@ -25870,9 +27789,9 @@ var $author$project$Gallery$Root$linkView = F2( 'gallery', A2( $elm$core$Basics$composeR, - $author$project$Gallery$Root$info, + $author$project$Gallery$Parent$info, function ($) { - return $.aK; + return $.az; })(example) ]), _List_Nil); @@ -25899,14 +27818,14 @@ var $author$project$Gallery$Root$linkView = F2( $elm$html$Html$text( A2( $elm$core$Basics$composeR, - $author$project$Gallery$Root$info, + $author$project$Gallery$Parent$info, function ($) { - return $.aA; + return $.ai; })(example)) ])) ])); }); -var $author$project$Gallery$Root$navigationView = function (currentPath) { +var $author$project$Gallery$Parent$navigationView = function (currentPath) { return A2( $elm$html$Html$div, _List_fromArray( @@ -25927,19 +27846,19 @@ var $author$project$Gallery$Root$navigationView = function (currentPath) { _List_Nil, A2( $elm$core$List$map, - $author$project$Gallery$Root$linkView(currentPath), + $author$project$Gallery$Parent$linkView(currentPath), _List_fromArray( [ - $author$project$Gallery$Root$Hanoi($author$project$Gallery$Hanoi$initialModel), - $author$project$Gallery$Root$Puzzle($author$project$Gallery$Puzzle$initialModel), - $author$project$Gallery$Root$Shapes($author$project$Gallery$Shapes$initialModel), - $author$project$Gallery$Root$Knight($author$project$Gallery$Knight$initialModel), - $author$project$Gallery$Root$TryOn($author$project$Gallery$TryOn$initialModel), - $author$project$Gallery$Root$TaskBoard($author$project$Gallery$TaskBoard$initialModel) + $author$project$Gallery$Parent$Hanoi($author$project$Gallery$Hanoi$initialModel), + $author$project$Gallery$Parent$Puzzle($author$project$Gallery$Puzzle$initialModel), + $author$project$Gallery$Parent$Shapes($author$project$Gallery$Shapes$initialModel), + $author$project$Gallery$Parent$Knight($author$project$Gallery$Knight$initialModel), + $author$project$Gallery$Parent$TryOn($author$project$Gallery$TryOn$initialModel), + $author$project$Gallery$Parent$TaskBoard($author$project$Gallery$TaskBoard$initialModel) ]))) ])); }; -var $author$project$Introduction$Root$linkView = F2( +var $author$project$Introduction$Parent$linkView = F2( function (currentPath, example) { var path = A2( $elm$url$Url$Builder$absolute, @@ -25949,9 +27868,9 @@ var $author$project$Introduction$Root$linkView = F2( 'introduction', A2( $elm$core$Basics$composeR, - $author$project$Introduction$Root$info, + $author$project$Introduction$Parent$info, function ($) { - return $.aK; + return $.az; })(example) ]), _List_Nil); @@ -25978,14 +27897,14 @@ var $author$project$Introduction$Root$linkView = F2( $elm$html$Html$text( A2( $elm$core$Basics$composeR, - $author$project$Introduction$Root$info, + $author$project$Introduction$Parent$info, function ($) { - return $.aA; + return $.ai; })(example)) ])) ])); }); -var $author$project$Introduction$Root$navigationView = function (currentPath) { +var $author$project$Introduction$Parent$navigationView = function (currentPath) { return A2( $elm$html$Html$div, _List_fromArray( @@ -26006,18 +27925,18 @@ var $author$project$Introduction$Root$navigationView = function (currentPath) { _List_Nil, A2( $elm$core$List$map, - $author$project$Introduction$Root$linkView(currentPath), + $author$project$Introduction$Parent$linkView(currentPath), _List_fromArray( [ - $author$project$Introduction$Root$Basic($author$project$Introduction$Basic$initialModel), - $author$project$Introduction$Root$BasicElmUI($author$project$Introduction$BasicElmUI$initialModel), - $author$project$Introduction$Root$Handle($author$project$Introduction$Handle$initialModel), - $author$project$Introduction$Root$Keyed($author$project$Introduction$Keyed$initialModel), - $author$project$Introduction$Root$Margins($author$project$Introduction$Margins$initialModel), - $author$project$Introduction$Root$Masonry($author$project$Introduction$Masonry$initialModel), - $author$project$Introduction$Root$Resize($author$project$Introduction$Resize$initialModel), - $author$project$Introduction$Root$Independents($author$project$Introduction$Independents$initialModel), - $author$project$Introduction$Root$Groups($author$project$Introduction$Groups$initialModel) + $author$project$Introduction$Parent$Basic($author$project$Introduction$Basic$initialModel), + $author$project$Introduction$Parent$BasicElmUI($author$project$Introduction$BasicElmUI$initialModel), + $author$project$Introduction$Parent$Handle($author$project$Introduction$Handle$initialModel), + $author$project$Introduction$Parent$Keyed($author$project$Introduction$Keyed$initialModel), + $author$project$Introduction$Parent$Margins($author$project$Introduction$Margins$initialModel), + $author$project$Introduction$Parent$Masonry($author$project$Introduction$Masonry$initialModel), + $author$project$Introduction$Parent$Resize($author$project$Introduction$Resize$initialModel), + $author$project$Introduction$Parent$Independents($author$project$Introduction$Independents$initialModel), + $author$project$Introduction$Parent$Groups($author$project$Introduction$Groups$initialModel) ]))) ])); }; @@ -26026,7 +27945,7 @@ var $author$project$Home$view = function (model) { }; var $author$project$Main$view = function (model) { return { - cy: _List_fromArray( + cO: _List_fromArray( [ A2( $elm$html$Html$div, @@ -26045,19 +27964,19 @@ var $author$project$Main$view = function (model) { A2( $elm$html$Html$map, $author$project$Main$IntroductionMsg, - $author$project$Introduction$Root$navigationView(model.z)), + $author$project$Introduction$Parent$navigationView(model.A)), A2( $elm$html$Html$map, - $author$project$Main$ConfigMsg, - $author$project$Config$Root$navigationView(model.z)), + $author$project$Main$DnDListMsg, + $author$project$DnDList$Parent$navigationView(model.A)), A2( $elm$html$Html$map, - $author$project$Main$ConfigGroupsMsg, - $author$project$ConfigGroups$Root$navigationView(model.z)), + $author$project$Main$DnDListGroupsMsg, + $author$project$DnDListGroups$Parent$navigationView(model.A)), A2( $elm$html$Html$map, $author$project$Main$GalleryMsg, - $author$project$Gallery$Root$navigationView(model.z)) + $author$project$Gallery$Parent$navigationView(model.A)) ])) ])), A2( @@ -26067,7 +27986,7 @@ var $author$project$Main$view = function (model) { $elm$html$Html$Attributes$id('main') ]), function () { - var _v0 = model.s; + var _v0 = model.u; switch (_v0.$) { case 0: return _List_fromArray( @@ -26090,15 +28009,15 @@ var $author$project$Main$view = function (model) { A2( $elm$html$Html$map, $author$project$Main$IntroductionMsg, - $author$project$Introduction$Root$headerView(mo)), + $author$project$Introduction$Parent$headerView(mo)), A2( $elm$html$Html$map, $author$project$Main$IntroductionMsg, - $author$project$Introduction$Root$demoView(mo)), + $author$project$Introduction$Parent$demoView(mo)), A2( $elm$html$Html$map, $author$project$Main$IntroductionMsg, - $author$project$Introduction$Root$codeView(mo)) + $author$project$Introduction$Parent$codeView(mo)) ]); case 3: var mo = _v0.a; @@ -26106,16 +28025,16 @@ var $author$project$Main$view = function (model) { [ A2( $elm$html$Html$map, - $author$project$Main$ConfigMsg, - $author$project$Config$Root$headerView(mo)), + $author$project$Main$DnDListMsg, + $author$project$DnDList$Parent$headerView(mo)), A2( $elm$html$Html$map, - $author$project$Main$ConfigMsg, - $author$project$Config$Root$demoView(mo)), + $author$project$Main$DnDListMsg, + $author$project$DnDList$Parent$demoView(mo)), A2( $elm$html$Html$map, - $author$project$Main$ConfigMsg, - $author$project$Config$Root$codeView(mo)) + $author$project$Main$DnDListMsg, + $author$project$DnDList$Parent$codeView(mo)) ]); case 4: var mo = _v0.a; @@ -26123,16 +28042,16 @@ var $author$project$Main$view = function (model) { [ A2( $elm$html$Html$map, - $author$project$Main$ConfigGroupsMsg, - $author$project$ConfigGroups$Root$headerView(mo)), + $author$project$Main$DnDListGroupsMsg, + $author$project$DnDListGroups$Parent$headerView(mo)), A2( $elm$html$Html$map, - $author$project$Main$ConfigGroupsMsg, - $author$project$ConfigGroups$Root$demoView(mo)), + $author$project$Main$DnDListGroupsMsg, + $author$project$DnDListGroups$Parent$demoView(mo)), A2( $elm$html$Html$map, - $author$project$Main$ConfigGroupsMsg, - $author$project$ConfigGroups$Root$codeView(mo)) + $author$project$Main$DnDListGroupsMsg, + $author$project$DnDListGroups$Parent$codeView(mo)) ]); default: var mo = _v0.a; @@ -26141,23 +28060,23 @@ var $author$project$Main$view = function (model) { A2( $elm$html$Html$map, $author$project$Main$GalleryMsg, - $author$project$Gallery$Root$headerView(mo)), + $author$project$Gallery$Parent$headerView(mo)), A2( $elm$html$Html$map, $author$project$Main$GalleryMsg, - $author$project$Gallery$Root$demoView(mo)), + $author$project$Gallery$Parent$demoView(mo)), A2( $elm$html$Html$map, $author$project$Main$GalleryMsg, - $author$project$Gallery$Root$codeView(mo)) + $author$project$Gallery$Parent$codeView(mo)) ]); } }()) ]), - aA: 'annaghi | dnd-list' + ai: 'annaghi | dnd-list' }; }; var $author$project$Main$main = $elm$browser$Browser$application( - {c9: $author$project$Main$init, dp: $author$project$Main$UrlChanged, dq: $author$project$Main$LinkClicked, b5: $author$project$Main$subscriptions, b9: $author$project$Main$update, d3: $author$project$Main$view}); + {di: $author$project$Main$init, dv: $author$project$Main$UrlChanged, dw: $author$project$Main$LinkClicked, cm: $author$project$Main$subscriptions, cq: $author$project$Main$update, d7: $author$project$Main$view}); _Platform_export({'Main':{'init':$author$project$Main$main( $elm$json$Json$Decode$succeed(0))(0)}});}(this)); \ No newline at end of file diff --git a/elm.json b/elm.json index 05a5bbe..310b736 100755 --- a/elm.json +++ b/elm.json @@ -3,9 +3,10 @@ "name": "annaghi/dnd-list", "summary": "Drag and Drop for sortable lists in Elm web apps with mouse support", "license": "BSD-3-Clause", - "version": "6.0.0", + "version": "7.0.0", "exposed-modules": [ "DnDList", + "DnDList.Single", "DnDList.Groups" ], "elm-version": "0.19.1 <= v < 0.20.0", diff --git a/examples/assets/custom-element-elm-code.js b/examples/assets/custom-element-elm-code.js index c8e024d..8e4c54d 100755 --- a/examples/assets/custom-element-elm-code.js +++ b/examples/assets/custom-element-elm-code.js @@ -1,51 +1,51 @@ class ElmCodeElement extends HTMLElement { - constructor() { - super(); - this._elm = { href: '' }; - } - - get href() { - return this._elm.href; - } + constructor() { + super(); + this._elm = { href: "" }; + } - set href(value) { - if (value === this._elm.href) { - return; + get href() { + return this._elm.href; } - this._elm.href = value; - this._highlight(); - } - _highlight() { - fetch(this._elm.href) - .then(response => { - return response.text(); - }) - .then(source => { - if (this._pre) { - this._pre.parentNode.removeChild(this._pre); - } - if (this._code) { - this._code.parentNode.removeChild(this._code); + set href(value) { + if (value === this._elm.href) { + return; } + this._elm.href = value; + this._highlight(); + } - this._pre = document.createElement('pre'); - this._code = document.createElement('code'); - this._code.innerHTML = source; - this._pre.appendChild(this._code); - this.appendChild(this._pre); + _highlight() { + fetch(this._elm.href) + .then((response) => { + return response.text(); + }) + .then((source) => { + if (this._pre) { + this._pre.parentNode.removeChild(this._pre); + } + if (this._code) { + this._code.parentNode.removeChild(this._code); + } - hljs.highlightBlock(this._code); - }); - } + this._pre = document.createElement("pre"); + this._code = document.createElement("code"); + this._code.innerHTML = source; + this._pre.appendChild(this._code); + this.appendChild(this._pre); - connectedCallback() { - setTimeout(() => { - if (this._elm.href !== '') { - this._highlight(); - } - }); - } + hljs.highlightBlock(this._code); + }); + } + + connectedCallback() { + setTimeout(() => { + if (this._elm.href !== "") { + this._highlight(); + } + }); + } } -window.customElements.define('elm-code', ElmCodeElement); +window.customElements.define("elm-code", ElmCodeElement); diff --git a/examples/assets/highlight/CHANGES.md b/examples/assets/highlight/CHANGES.md index ca4b82b..d48df8d 100644 --- a/examples/assets/highlight/CHANGES.md +++ b/examples/assets/highlight/CHANGES.md @@ -1,10 +1,334 @@ -## Master +## Version 10.0.3 +- [Issue](https://github.com/highlightjs/highlight.js/issues/2514) fix(javascript) Fix `get`/`set` incorrect highlighting (#2515) [Josh Goebel][] + +[Josh Goebel]: https://github.com/yyyc514 + + +## Version 10.0.2 + +Brower build: + +- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (bug) Fix: Version 10 fails to load as CommonJS module. (#2511) [Josh Goebel][] +- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (removal) AMD module loading support has been removed. (#2511) [Josh Goebel][] + +Parser Engine Changes: + +- [Issue](https://github.com/highlightjs/highlight.js/issues/2522) fix(parser) Fix freeze issue with illegal 0 width matches (#2524) [Josh Goebel][] + + +[Josh Goebel]: https://github.com/yyyc514 + + +## Version 10.0.1 + +Parser Engine Changes: + +- (bug) Fix sublanguage with no relevance score (#2506) [Josh Goebel][] + +[Josh Goebel]: https://github.com/yyyc514 + + +## Version 10.0.0 + +New languages: + +- add(php-template) Explicit language to detect PHP templates (vs xml) [Josh Goebel][] +- enh(python) Added `python-repl` for Python REPL sessions +- add(never) Added 3rd party Never language support + +New themes: + +- *Srcery* by [Chen Bin][] + +Parser Engine Changes: + +- (bug) Fix `beginKeywords` to ignore . matches (#2434) [Josh Goebel][] +- (enh) add `before:highlight` plugin API callback (#2395) [Josh Goebel][] +- (enh) add `after:highlight` plugin API callback (#2395) [Josh Goebel][] +- (enh) split out parse tree generation and HTML rendering concerns (#2404) [Josh Goebel][] +- (enh) every language can have a `name` attribute now (#2400) [Josh Goebel][] +- (enh) improve regular expression detect (less false-positives) (#2380) [Josh Goebel][] +- (enh) make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][] + +Language Improvements: + +- enh(python) Exclude parens from functions params (#2490) [Álvaro Mondéjar][] +- enh(swift) Add `compactMap` to keywords as built_in (#2478) [Omid Golparvar][] +- enh(nim) adds `func` keyword (#2468) [Adnan Yaqoob][] +- enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][] +- fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][] +- bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][] +- enh(bash) default value is another variable (#2439) [Josh Goebel][] +- enh(bash) string nested within string (#2439) [Josh Goebel][] +- enh(bash) Add arithmetic expression support (#2439) [Josh Goebel][] +- enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][] +- enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][] +- (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][] +- fix(elixir) Support function names with a slash (#2406) [Josh Goebel][] +- fix(javascript) comma is allowed in a "value container" (#2403) [Josh Goebel][] +- enh(apache) add `deny` and `allow` keywords [Josh Goebel][] +- enh(apache) highlight numeric attributes values [Josh Goebel][] +- enh(apache) highlight IP addresses, ports, and strings in sections [Josh Goebel][] +- enh(php) added more keywords and include ` - + ``` @@ -27,23 +35,33 @@ work for you, you can specify the language in the `class` attribute:
...
``` -The list of supported language classes is available in the [class -reference][2]. Classes can also be prefixed with either `language-` or -`lang-`. +Classes may also be prefixed with either `language-` or `lang-`. + +```html +
...
+``` + +### Plaintext and Disabling Highlighting -To make arbitrary text look like code, but without highlighting, use the +To style arbitrary text like code, but without any highlighting, use the `plaintext` class: ```html
...
``` -To disable highlighting altogether use the `nohighlight` class: +To disable highlighting of a tag completely, use the `nohighlight` class: ```html
...
``` +### Supported Languages + +Highlight.js supports over 180 different languages in the core library. There are also 3rd party +language plugins available for additional languages. You can find the full list of supported languages +in [SUPPORTED_LANGUAGES.md][9]. + ## Custom Initialization When you need a bit more control over the initialization of @@ -96,12 +114,61 @@ In worker.js: ```js onmessage = (event) => { - importScripts('/highlight.pack.js'); + importScripts('/highlight.min.js'); const result = self.hljs.highlightAuto(event.data); postMessage(result.value); }; ``` +## Node.js + +You can use highlight.js with node to highlight content before sending it to the browser. +Make sure to use the `.value` property to get the formatted html. +For more info about the returned object refer to the api docs https://highlightjs.readthedocs.io/en/latest/api.html + + +```js +// require the highlight.js library, including all languages +const hljs = require('./highlight.js'); +const highlightedCode = hljs.highlightAuto('Hello World!').value +``` + +Or for a smaller footprint... load just the languages you need. + +```js +const hljs = require("highlight.js/lib/core"); // require only the core library +// separately require languages +hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')); + +const highlightedCode = hljs.highlight('xml', 'Hello World!').value +``` + + +## ES6 Modules + +First, you'll likely install via `npm` or `yarn` -- see [Getting the Library](#getting-the-library) below. + +In your application: + +```js +import hljs from 'highlight.js'; +``` + +The default import imports all languages. Therefore it is likely to be more efficient to import only the library and the languages you need: + +```js +import hljs from 'highlight.js/lib/core'; +import javascript from 'highlight.js/lib/languages/javascript'; +hljs.registerLanguage('javascript', javascript); +``` + +To set the syntax highlighting style, if your build tool processes CSS from your JavaScript entry point, you can also import the stylesheet directly as modules: + +```js +import hljs from 'highlight.js/lib/core'; +import 'highlight.js/styles/github.css'; +``` + ## Getting the Library @@ -111,22 +178,12 @@ both AMD and CommonJS, so if you wish you can use RequireJS or Browserify without having to build from source. The server module also works perfectly fine with Browserify, but there is the option to use a build specific to browsers rather than something meant for a server. -Head over to the [download page][5] for all the options. -**Don't link to GitHub directly.** The library is not supposed to work straight + +**Do not link to GitHub directly.** The library is not supposed to work straight from the source, it requires building. If none of the pre-packaged options work for you refer to the [building documentation][6]. -**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be -too big. If you don't see the language you need in the ["Common" section][5], -it can be added manually: - -```html - -``` - **On Almond.** You need to use the optimizer to give the module a name. For example: @@ -134,41 +191,84 @@ example: r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js ``` +### CDN Hosted -### CommonJS +A prebuilt version of highlight.js bundled with many common languages is hosted by the following CDNs: -You can import Highlight.js as a CommonJS-module: +**cdnjs** ([link](https://cdnjs.com/libraries/highlight.js)) -```bash -npm install highlight.js --save +```html + + + + ``` -In your application: +**jsdelivr** ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) -```js -import hljs from 'highlight.js'; +```html + + ``` -The default import imports all languages! Therefore it is likely to be more efficient to import only the library and the languages you need: +**Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be +very large. You can find our list "common" languages that we bundle by default on our [download page][5]. -```js -import hljs from 'highlight.js/lib/highlight'; -import javascript from 'highlight.js/lib/languages/javascript'; -hljs.registerLanguage('javascript', javascript); +### Self Hosting + +The [download page][5] can quickly generate a custom bundle including only the languages you need. + +Alternatively, you can build a browser package from [source](#source): + +``` +node tools/build.js -t browser :common ``` -To set the syntax highlighting style, if your build tool processes CSS from your JavaScript entry point, you can import the stylesheet directly into your CommonJS-module: +See our [building documentation][6] for more information. -```js -import hljs from 'highlight.js/lib/highlight'; -import 'highlight.js/styles/github.css'; +**Note:** Building from source should always result in the smallest size builds. The website download page is optimized for speed, not size. + + +#### Prebuilt CDN assets + +You can also download and self-host the same assets we serve up via our own CDNs. We publish those builds to the [cdn-release](https://github.com/highlightjs/cdn-release) GitHub repository. You can easily pull individual files off the CDN endpoints with `curl`, etc; if say you only needed `highlight.min.js` and a single CSS file. + +There is also an npm package [@highlightjs/cdn-assets](https://www.npmjs.com/package/@highlightjs/cdn-assets) if pulling the assets in via `npm` or `yarn` would be easier for your build process. + + +### NPM / Node.js server module + +Highlight.js can also be used on the server. The package with all supported languages can be installed from NPM or Yarn: + +```bash +npm install highlight.js +# or +yarn add highlight.js ``` +Alternatively, you can build it from [source](#source): + +```bash +node tools/build.js -t node +``` + +See our [building documentation][6] for more information. + + +### Source + +[Current source][10] is always available on GitHub. + + ## License Highlight.js is released under the BSD License. See [LICENSE][7] file for details. + ## Links The official site for the library is at . @@ -176,7 +276,7 @@ The official site for the library is at . Further in-depth documentation for the API and other topics is at . -Authors and contributors are listed in the [AUTHORS.en.txt][8] file. +Authors and contributors are listed in the [AUTHORS.txt][8] file. [1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload [2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html @@ -185,4 +285,6 @@ Authors and contributors are listed in the [AUTHORS.en.txt][8] file. [5]: https://highlightjs.org/download/ [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html [7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE -[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.en.txt +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.txt +[9]: https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md +[10]: https://github.com/highlightjs/ diff --git a/examples/assets/highlight/README.ru.md b/examples/assets/highlight/README.ru.md index 198ee96..a448e21 100644 --- a/examples/assets/highlight/README.ru.md +++ b/examples/assets/highlight/README.ru.md @@ -12,7 +12,7 @@ Highlight.js — это инструмент для подсветки синт ```html - + ``` @@ -85,7 +85,7 @@ addEventListener('load', () => { ```js onmessage = (event) => { - importScripts('/highlight.pack.js'); + importScripts('/highlight.min.js'); const result = self.hljs.highlightAuto(event.data); postMessage(result.value); }; @@ -107,7 +107,8 @@ Highlight.js можно использовать в браузере прямо вручную: ```html - + ``` **Про Almond.** Нужно задать имя модуля в оптимизаторе, например: @@ -130,7 +131,7 @@ Highlight.js распространяется под лицензией BSD. П Более подробная документация по API и другим темам расположена на . -Авторы и контрибьюторы перечислены в файле [AUTHORS.ru.txt][8] file. +Авторы и контрибьюторы перечислены в файле [AUTHORS.txt][8] file. [1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload [2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html @@ -139,4 +140,4 @@ Highlight.js распространяется под лицензией BSD. П [5]: https://highlightjs.org/download/ [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html [7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE -[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.ru.txt +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.txt diff --git a/examples/assets/highlight/highlight.pack.js b/examples/assets/highlight/highlight.pack.js index f5a8e57..e6bc0f6 100644 --- a/examples/assets/highlight/highlight.pack.js +++ b/examples/assets/highlight/highlight.pack.js @@ -1,2 +1,6 @@ -/*! highlight.js v9.15.6 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var E=[],u=Object.keys,N={},g={},n=/^(no-?highlight|plain|text)$/i,R=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function d(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function p(e){return n.test(e)}function l(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function M(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),d(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(c){function s(e){return e&&e.source||e}function o(e,n){return new RegExp(s(e),"m"+(c.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){var r={},a=function(t,e){c.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");r[n[0]]=[t,n[1]?Number(n[1]):1]})};"string"==typeof t.k?a("keyword",t.k):u(t.k).forEach(function(e){a(e,t.k[e])}),t.k=r}t.lR=o(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=o(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=o(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=o(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return(n="self"===e?t:e).v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return l(n,{v:null},e)})),n.cached_variants||n.eW&&[l(n)]||[n];var n})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?o(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b)}function s(){g+=null!=E.sL?function(){var e="string"==typeof E.sL;if(e&&!N[E.sL])return _(R);var n=e?C(E.sL,R,!0,i[E.sL]):O(R,E.sL.length?E.sL:void 0);return 0")+'"');return R+=n,n.length||1}var f=S(e);if(!f)throw new Error('Unknown language: "'+e+'"');m(f);var a,E=t||f,i={},g="";for(a=E;a!==f;a=a.parent)a.cN&&(g=u(a.cN,"",!0)+g);var R="",d=0;try{for(var c,p,M=0;E.t.lastIndex=M,c=E.t.exec(n);)p=r(n.substring(M,c.index),c[0]),M=c.index+p;for(r(n.substr(M)),a=E;a.parent;a=a.parent)a.cN&&(g+=b);return{r:d,value:g,language:e,top:E}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(S).filter(s).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function B(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function c(e){var n,t,r,a,i,c,o,u,s,l,f=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=R.exec(i))return S(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=f?C(f,i,!0):O(i),(t=M(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function c(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?o:u)(e.node)}for(;e.length||n.length;){var l=c();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=c())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(o)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,M(a),i)),r.value=B(r.value),e.innerHTML=r.value,e.className=(c=e.className,o=f,u=r.language,s=o?g[o]:u,l=[c.trim()],c.match(/\bhljs\b/)||l.push("hljs"),-1===c.indexOf(s)&&l.push(s),l.join(" ").trim()),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function o(){if(!o.called){o.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,c)}}function S(e){return e=(e||"").toLowerCase(),N[e]||N[g[e]]}function s(e){var n=S(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=B,a.highlightBlock=c,a.configure=function(e){h=l(h,e)},a.initHighlighting=o,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",o,!1),addEventListener("load",o,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){g[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=S,a.autoDetection=s,a.inherit=l,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("elm",function(e){var i={v:[e.C("--","$"),e.C("{-","-}",{c:["self"]})]},t={cN:"type",b:"\\b[A-Z][\\w']*",r:0},c={b:"\\(",e:"\\)",i:'"',c:[{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},i]};return{k:"let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription",c:[{bK:"port effect module",e:"exposing",k:"port effect module where command subscription exposing",c:[c,i],i:"\\W\\.|;"},{b:"import",e:"$",k:"import as exposing",c:[c,i],i:"\\W\\.|;"},{b:"type",e:"$",k:"type alias",c:[t,c,{b:"{",e:"}",c:c.c},i]},{bK:"infix infixl infixr",e:"$",c:[e.CNM,i]},{b:"port",e:"$",k:"port",c:[i]},{cN:"string",b:"'\\\\?.",e:"'",i:"."},e.QSM,e.CNM,t,e.inherit(e.TM,{b:"^[_a-z][\\w']*"}),i,{b:"->|<-"}],i:/;/}}); \ No newline at end of file +/* + Highlight.js 10.0.3 (a4b1bd2d) + License: BSD-3-Clause + Copyright (c) 2006-2020, Ivan Sagalaev +*/ +var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!n.hasOwnProperty(r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach((function(e){for(n in e)t[n]=e[n]})),t}function r(e){return e.nodeName.toLowerCase()}var a=Object.freeze({__proto__:null,escapeHTML:n,inherit:t,nodeStream:function(e){var n=[];return function e(t,a){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=e(i,a),r(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n},mergeStreams:function(e,t,a){var i=0,s="",o=[];function l(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){s+=""}function d(e){("start"===e.event?c:u)(e.node)}for(;e.length||t.length;){var g=l();if(s+=n(a.substring(i,g[0].offset)),i=g[0].offset,g===e){o.reverse().forEach(u);do{d(g.splice(0,1)[0]),g=l()}while(g===e&&g.length&&g[0].offset===i);o.reverse().forEach(c)}else"start"===g[0].event?o.push(g[0].node):o.pop(),d(g.splice(0,1)[0])}return s+n(a.substr(i))}});const i="",s=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=n(e)}openNode(e){if(!s(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){s(e)&&(this.buffer+=i)}span(e){this.buffer+=``}value(){return this.buffer}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){e.children&&(e.children.every(e=>"string"==typeof e)?(e.text=e.children.join(""),delete e.children):e.children.forEach(e=>{"string"!=typeof e&&l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){let t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){}}function u(e){return e&&e.source||e}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g={begin:"\\\\[\\s\\S]",relevance:0},h={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[g]},f={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[g]},p={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},m=function(e,n,r){var a=t({className:"comment",begin:e,end:n,contains:[]},r||{});return a.contains.push(p),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),a},b=m("//","$"),v=m("/\\*","\\*/"),x=m("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",BACKSLASH_ESCAPE:g,APOS_STRING_MODE:h,QUOTE_STRING_MODE:f,PHRASAL_WORDS_MODE:p,COMMENT:m,C_LINE_COMMENT_MODE:b,C_BLOCK_COMMENT_MODE:v,HASH_COMMENT_MODE:x,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:d,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^\/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[g,{begin:/\[/,end:/\]/,relevance:0,contains:[g]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0}}),E="of and for in not or if then".split(" ");function R(e,n){return n?+n:(t=e,E.includes(t.toLowerCase())?0:1);var t}const N=n,w=t,{nodeStream:y,mergeStreams:O}=a;return function(n){var r=[],a={},i={},s=[],o=!0,l=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,d="Could not find the language '{}', did you forget to load/include a language module?",g={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0,__emitter:c};function h(e){return g.noHighlightRe.test(e)}function f(e,n,t,r){var a={code:n,language:e};T("before:highlight",a);var i=a.result?a.result:p(a.language,a.code,t,r);return i.code=a.code,T("after:highlight",i),i}function p(e,n,r,i){var s=n;function l(e,n){var t=v.case_insensitive?n[0].toLowerCase():n[0];return e.keywords.hasOwnProperty(t)&&e.keywords[t]}function c(){null!=_.subLanguage?function(){if(""!==k){var e="string"==typeof _.subLanguage;if(!e||a[_.subLanguage]){var n=e?p(_.subLanguage,k,!0,E[_.subLanguage]):m(k,_.subLanguage.length?_.subLanguage:void 0);_.relevance>0&&(T+=n.relevance),e&&(E[_.subLanguage]=n.top),w.addSublanguage(n.emitter,n.language)}else w.addText(k)}}():function(){var e,n,t,r;if(_.keywords){for(n=0,_.lexemesRe.lastIndex=0,t=_.lexemesRe.exec(k),r="";t;){r+=k.substring(n,t.index);var a=null;(e=l(_,t))?(w.addText(r),r="",T+=e[1],a=e[0],w.addKeyword(t[0],a)):r+=t[0],n=_.lexemesRe.lastIndex,t=_.lexemesRe.exec(k)}r+=k.substr(n),w.addText(r)}else w.addText(k)}(),k=""}function h(e){e.className&&w.openNode(e.className),_=Object.create(e,{parent:{value:_}})}var f={};function b(n,t){var a,i=t&&t[0];if(k+=n,null==i)return c(),0;if("begin"==f.type&&"end"==t.type&&f.index==t.index&&""===i){if(k+=s.slice(t.index,t.index+1),!o)throw(a=Error("0 width match regex")).languageName=e,a.badRule=f.rule,a;return 1}if(f=t,"begin"===t.type)return function(e){var n=e[0],t=e.rule;return t.__onBegin&&(t.__onBegin(e)||{}).ignoreMatch?function(e){return 0===_.matcher.regexIndex?(k+=e[0],1):(B=!0,0)}(n):(t&&t.endSameAsBegin&&(t.endRe=RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),t.skip?k+=n:(t.excludeBegin&&(k+=n),c(),t.returnBegin||t.excludeBegin||(k=n)),h(t),t.returnBegin?0:n.length)}(t);if("illegal"===t.type&&!r)throw(a=Error('Illegal lexeme "'+i+'" for mode "'+(_.className||"")+'"')).mode=_,a;if("end"===t.type){var l=function(e){var n=e[0],t=s.substr(e.index),r=function e(n,t){if(function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(n.endRe,t)){for(;n.endsParent&&n.parent;)n=n.parent;return n}if(n.endsWithParent)return e(n.parent,t)}(_,t);if(r){var a=_;a.skip?k+=n:(a.returnEnd||a.excludeEnd||(k+=n),c(),a.excludeEnd&&(k=n));do{_.className&&w.closeNode(),_.skip||_.subLanguage||(T+=_.relevance),_=_.parent}while(_!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),h(r.starts)),a.returnEnd?0:n.length}}(t);if(null!=l)return l}if("illegal"===t.type&&""===i)return 1;if(A>1e5&&A>3*t.index)throw Error("potential infinite loop, way more iterations than matches");return k+=i,i.length}var v=M(e);if(!v)throw console.error(d.replace("{}",e)),Error('Unknown language: "'+e+'"');!function(e){function n(n,t){return RegExp(u(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+="|"),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"==l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("==l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let n=this.matcherRe.exec(e);if(!n)return null;let t=n.findIndex((e,n)=>n>0&&null!=e),r=this.matchIndexes[t];return Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let n=new r;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){let n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),t}}function i(e){let n=e.input[e.index-1],t=e.input[e.index+e[0].length];if("."===n||"."===t)return{ignoreMatch:!0}}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");!function r(s,o){s.compiled||(s.compiled=!0,s.__onBegin=null,s.keywords=s.keywords||s.beginKeywords,s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,R(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemesRe=n(s.lexemes||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__onBegin=i),s.begin||(s.begin=/\B|\b/),s.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(s.endRe=n(s.end)),s.terminator_end=u(s.end)||"",s.endsWithParent&&o.terminator_end&&(s.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(s.illegalRe=n(s.illegal)),null==s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return t(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?t(e,{starts:e.starts?t(e.starts):null}):Object.isFrozen(e)?t(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){r(e,s)})),s.starts&&r(s.starts,o),s.matcher=function(e){let n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s))}(e)}(v);var x,_=i||v,E={},w=new g.__emitter(g);!function(){for(var e=[],n=_;n!==v;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>w.openNode(e))}();var y,O,k="",T=0,L=0,A=0,B=!1;try{for(_.matcher.considerAll();A++,B?B=!1:(_.matcher.lastIndex=L,_.matcher.considerAll()),y=_.matcher.exec(s);)O=b(s.substring(L,y.index),y),L=y.index+O;return b(s.substr(L)),w.closeAllNodes(),w.finalize(),x=w.toHTML(),{relevance:T,value:x,language:e,illegal:!1,emitter:w,top:_}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:s.slice(L-100,L+100),mode:n.mode},sofar:x,relevance:0,value:N(s),emitter:w};if(o)return{relevance:0,value:N(s),emitter:w,language:e,top:_,errorRaised:n};throw n}}function m(e,n){n=n||g.languages||Object.keys(a);var t=function(e){const n={relevance:0,emitter:new g.__emitter(g),value:N(e),illegal:!1,top:E};return n.emitter.addText(e),n}(e),r=t;return n.filter(M).filter(k).forEach((function(n){var a=p(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function b(e){return g.tabReplace||g.useBR?e.replace(l,(function(e,n){return g.useBR&&"\n"===e?"
":g.tabReplace?n.replace(/\t/g,g.tabReplace):""})):e}function v(e){var n,t,r,a,s,o=function(e){var n,t=e.className+" ";if(t+=e.parentNode?e.parentNode.className:"",n=g.languageDetectRe.exec(t)){var r=M(n[1]);return r||(console.warn(d.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>h(e)||M(e))}(e);h(o)||(T("before:highlightBlock",{block:e,language:o}),g.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e,s=n.textContent,r=o?f(o,s,!0):m(s),(t=y(n)).length&&((a=document.createElement("div")).innerHTML=r.value,r.value=O(t,y(a),s)),r.value=b(r.value),T("after:highlightBlock",{block:e,result:r}),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?i[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance}))}function x(){if(!x.called){x.called=!0;var e=document.querySelectorAll("pre code");r.forEach.call(e,v)}}const E={disableAutodetect:!0,name:"Plain text"};function M(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]}function k(e){var n=M(e);return n&&!n.disableAutodetect}function T(e,n){var t=e;s.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(n,{highlight:f,highlightAuto:m,fixMarkup:b,highlightBlock:v,configure:function(e){g=w(g,e)},initHighlighting:x,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",x,!1)},registerLanguage:function(e,t){var r;try{r=t(n)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!o)throw n;console.error(n),r=E}r.name||(r.name=e),a[e]=r,r.rawDefinition=t.bind(null,n),r.aliases&&r.aliases.forEach((function(n){i[n]=e}))},listLanguages:function(){return Object.keys(a)},getLanguage:M,requireLanguage:function(e){var n=M(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:k,inherit:w,addPlugin:function(e,n){s.push(e)}}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString="10.0.3";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(n,_),n}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);hljs.registerLanguage("css",function(){"use strict";return function(e){var n={begin:/(?:[A-Z\_\.\-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{name:"CSS",case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",illegal:/:/,returnBegin:!0,contains:[{className:"keyword",begin:/@\-?\w[\w]*(\-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:"and or not only",contains:[{begin:/[a-z-]+:/,className:"attribute"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,n]}]}}}());hljs.registerLanguage("elm",function(){"use strict";return function(e){var n={variants:[e.COMMENT("--","$"),e.COMMENT("{-","-}",{contains:["self"]})]},i={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},s={begin:"\\(",end:"\\)",illegal:'"',contains:[{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},n]};return{name:"Elm",keywords:"let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription",contains:[{beginKeywords:"port effect module",end:"exposing",keywords:"port effect module where command subscription exposing",contains:[s,n],illegal:"\\W\\.|;"},{begin:"import",end:"$",keywords:"import as exposing",contains:[s,n],illegal:"\\W\\.|;"},{begin:"type",end:"$",keywords:"type alias",contains:[i,s,{begin:"{",end:"}",contains:s.contains},n]},{beginKeywords:"infix infixl infixr",end:"$",contains:[e.C_NUMBER_MODE,n]},{begin:"port",end:"$",keywords:"port",contains:[n]},{className:"string",begin:"'\\\\?.",end:"'",illegal:"."},e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,i,e.inherit(e.TITLE_MODE,{begin:"^[_a-z][\\w']*"}),n,{begin:"->|<-"}],illegal:/;/}}}());hljs.registerLanguage("properties",function(){"use strict";return function(e){var n="[ \\t\\f]*",t="("+n+"[:=]"+n+"|[ \\t\\f]+)",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",s={end:t,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+"+t,returnBegin:!0,contains:[{className:"attr",begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",endsParent:!0,relevance:0}],starts:s},{begin:a+t,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:a,endsParent:!0,relevance:0}],starts:s},{className:"attr",relevance:0,begin:a+n+"$"}]}}}()); \ No newline at end of file diff --git a/examples/assets/highlight/styles/atom-one-light.css b/examples/assets/highlight/styles/atom-one-dark.css similarity index 60% rename from examples/assets/highlight/styles/atom-one-light.css rename to examples/assets/highlight/styles/atom-one-dark.css index d5bd1d2..1616aaf 100644 --- a/examples/assets/highlight/styles/atom-one-light.css +++ b/examples/assets/highlight/styles/atom-one-dark.css @@ -1,20 +1,20 @@ /* -Atom One Light by Daniel Gamage -Original One Light Syntax theme from https://github.com/atom/one-light-syntax +Atom One Dark by Daniel Gamage +Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax -base: #fafafa -mono-1: #383a42 -mono-2: #686b77 -mono-3: #a0a1a7 -hue-1: #0184bb -hue-2: #4078f2 -hue-3: #a626a4 -hue-4: #50a14f -hue-5: #e45649 -hue-5-2: #c91243 -hue-6: #986801 -hue-6-2: #c18401 +base: #282c34 +mono-1: #abb2bf +mono-2: #818896 +mono-3: #5c6370 +hue-1: #56b6c2 +hue-2: #61aeee +hue-3: #c678dd +hue-4: #98c379 +hue-5: #e06c75 +hue-5-2: #be5046 +hue-6: #d19a66 +hue-6-2: #e6c07b */ @@ -22,20 +22,20 @@ hue-6-2: #c18401 display: block; overflow-x: auto; padding: 0.5em; - color: #383a42; - background: #fafafa; + color: #abb2bf; + background: #282c34; } .hljs-comment, .hljs-quote { - color: #a0a1a7; + color: #5c6370; font-style: italic; } .hljs-doctag, .hljs-keyword, .hljs-formula { - color: #a626a4; + color: #c678dd; } .hljs-section, @@ -43,11 +43,11 @@ hue-6-2: #c18401 .hljs-selector-tag, .hljs-deletion, .hljs-subst { - color: #e45649; + color: #e06c75; } .hljs-literal { - color: #0184bb; + color: #56b6c2; } .hljs-string, @@ -55,12 +55,12 @@ hue-6-2: #c18401 .hljs-addition, .hljs-attribute, .hljs-meta-string { - color: #50a14f; + color: #98c379; } .hljs-built_in, .hljs-class .hljs-title { - color: #c18401; + color: #e6c07b; } .hljs-attr, @@ -71,7 +71,7 @@ hue-6-2: #c18401 .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { - color: #986801; + color: #d19a66; } .hljs-symbol, @@ -80,7 +80,7 @@ hue-6-2: #c18401 .hljs-meta, .hljs-selector-id, .hljs-title { - color: #4078f2; + color: #61aeee; } .hljs-emphasis { diff --git a/examples/assets/highlight/styles/grayscale.css b/examples/assets/highlight/styles/grayscale.css new file mode 100644 index 0000000..5376f34 --- /dev/null +++ b/examples/assets/highlight/styles/grayscale.css @@ -0,0 +1,101 @@ +/* + +grayscale style (c) MY Sun + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #fff; +} + +.hljs-comment, +.hljs-quote { + color: #777; + font-style: italic; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { + color: #333; + font-weight: bold; +} + +.hljs-number, +.hljs-literal { + color: #777; +} + +.hljs-string, +.hljs-doctag, +.hljs-formula { + color: #333; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC) repeat; +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { + color: #000; + font-weight: bold; +} + +.hljs-subst { + font-weight: normal; +} + +.hljs-class .hljs-title, +.hljs-type, +.hljs-name { + color: #333; + font-weight: bold; +} + +.hljs-tag { + color: #333; +} + +.hljs-regexp { + color: #333; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==) repeat; +} + +.hljs-symbol, +.hljs-bullet, +.hljs-link { + color: #000; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==) repeat; +} + +.hljs-built_in, +.hljs-builtin-name { + color: #000; + text-decoration: underline; +} + +.hljs-meta { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + color: #fff; + background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==) repeat; +} + +.hljs-addition { + color: #000; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC) repeat; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/examples/elm.json b/examples/elm.json index 2ca1cbe..da4737a 100755 --- a/examples/elm.json +++ b/examples/elm.json @@ -1,28 +1,32 @@ { - "type": "application", - "source-directories": [ - "src", - "../src" - ], - "elm-version": "0.19.1", - "dependencies": { - "direct": { - "elm/browser": "1.0.2", - "elm/core": "1.0.5", - "elm/html": "1.0.0", - "elm/json": "1.1.3", - "elm/random": "1.0.0", - "elm/svg": "1.0.1", - "elm/url": "1.0.0", - "mdgriffith/elm-ui": "1.1.5" + "type": "application", + "source-directories": [ + "src", + "../src" + ], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "GlobalWebIndex/class-namespaces": "3.0.1", + "elm/browser": "1.0.2", + "elm/core": "1.0.5", + "elm/html": "1.0.0", + "elm/json": "1.1.3", + "elm/parser": "1.1.0", + "elm/random": "1.0.0", + "elm/regex": "1.0.0", + "elm/svg": "1.0.1", + "elm/url": "1.0.0", + "mdgriffith/elm-ui": "1.1.5", + "pzp1997/assoc-list": "1.0.0" + }, + "indirect": { + "elm/time": "1.0.0", + "elm/virtual-dom": "1.0.2" + } }, - "indirect": { - "elm/time": "1.0.0", - "elm/virtual-dom": "1.0.2" + "test-dependencies": { + "direct": {}, + "indirect": {} } - }, - "test-dependencies": { - "direct": {}, - "indirect": {} - } } \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 700d112..9d3c68f 100755 --- a/examples/index.html +++ b/examples/index.html @@ -1,27 +1,27 @@ - - - - - - - - - annaghi | dnd-list - - - - - - - - - - - - - - - - + + + + + + + + + annaghi | dnd-list + + + + + + + + + + + + + + + + diff --git a/examples/scss/styles-old.scss b/examples/scss/styles-old.scss new file mode 100644 index 0000000..dd75a76 --- /dev/null +++ b/examples/scss/styles-old.scss @@ -0,0 +1,370 @@ +@media (min-width: 640px) { + html { + font-size: 125%; + } +} + +@media (min-width: 900px) { + html { + font-size: 131.25%; + line-height: 1.4; + } +} + +@media (min-width: 1100px) { + html { + font-size: 137.5%; + } +} + +@media (min-width: 1800px) { + html { + font-size: 156.25%; + } +} + +@media (min-width: 2800px) { + html { + font-size: 175%; + } +} +*, +:after, +:before { + box-sizing: border-box; +} +html { + font-family: Work Sans, sans-serif; + font-size: 118.75%; + color: #343434; +} + +body { + padding: 0; + margin: 0; + + text-rendering: optimizeSpeed; +} + +ul { + list-style: none; + margin: 0; + padding: 0; +} + +li { + margin: 0; + padding: 0; +} + +a { + color: #5e81ac; + text-decoration: none; +} + +pre { + margin: 0; +} + +h1, +h2 { + padding: 0; + margin: 0; +} + +.hljs { + white-space: pre-wrap; + padding: 2rem 1rem; +} + +.dnd { + $max-width: 1100px; + + &.home { + height: 95vh; + width: 100%; + + display: flex; + flex-direction: column; + } + + &__header { + position: sticky; + top: 0; + left: 0; + + height: 4rem; + + display: flex; + align-items: center; + flex-shrink: 0; + + background-color: #ffffff; + border: 1px solid #eceff4; + + &--shell { + padding: 0 1rem; + margin: 0 auto; + max-width: $max-width; + + text-align: center; + + display: flex; + align-items: center; + flex-basis: 100%; + flex-shrink: 0; + + &--brand { + margin-right: auto; + } + + &--link { + margin-left: 1rem; + display: block; + + &:hover { + cursor: pointer; + } + + &--icon { + display: block; + line-height: 0; + } + + .home &.menu { + display: none; + } + } + } + } + + .home &__main { + padding: 0 1rem; + + display: flex; + flex-direction: column; + flex: 1; + + &--name { + padding: 2rem 0 3rem 0; + + text-align: center; + } + + &--description { + padding: 0 0 1rem 0; + text-align: center; + } + } + + .home &__nav { + padding: 0 1rem; + + display: flex; + flex-direction: column; + align-items: center; + flex: 1; + + &--section { + padding: 1rem 0 2rem 0; + + text-align: center; + + &--header { + padding-bottom: 1rem; + } + + &--links { + line-height: 1.7; + } + } + } + + .demo &__main { + &--header { + padding: 2rem 1rem 0 1rem; + /* TODO Decide when Title vs Name */ + &--title { + display: flex; + align-items: center; + + &--text { + margin-right: auto; + } + + &--link { + display: flex; + align-items: center; + + &--label { + padding-right: 0.7rem; + } + + &--icon { + display: block; + line-height: 0; + } + } + } + + &--description { + padding-bottom: 1rem; + } + } + &--demo { + padding: 2rem 1rem 4rem 1rem; + text-align: center; + } + + &--code { + } + } + + .demo &__nav { + display: block; + + position: fixed; + visibility: hidden; + top: 0; + right: -100%; + + width: 300px; + height: 100%; + + margin: 0; + padding: 80px 0; + + background-color: #eceff1; + box-shadow: -5px 0px 6px rgba(0, 0, 0, 0.2); + + transition-duration: 0.25s; + + &.show { + visibility: visible; + right: 0; + } + } + + &__footer { + padding: 0 1rem; + margin: 0 auto; + max-width: $max-width; + + height: 4rem; + + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + + .home & { + margin-bottom: -5vh; + } + + &--author { + text-align: center; + font-size: smaller; + color: #777777; + } + } +} + +@media (min-width: 480px) { +} + +@media (min-width: 600px) { +} + +@media (min-width: 700px) { +} + +@media (min-width: 1000px) { + .dnd { + &.demo { + display: grid; + grid-template-areas: + "header header" + "menu content" + "menu footer"; + + height: 100vh; + } + + &__header { + grid-area: header; + + &--shell { + &--link.menu { + display: none; + } + } + } + + .home &__main { + display: flex; + flex-direction: column; + justify-content: center; + flex: 1; + flex-basis: 50%; + + &--name { + padding: 2rem 0 2rem 0; + } + + &--description { + } + } + + .home &__nav { + display: flex; + justify-content: center; + flex-basis: 50%; + + &--section { + flex-basis: 50%; + } + } + + .demo &__main { + grid-area: content; + + overflow: hidden; + height: 100%; + display: flex; + flex-direction: column; + + flex: 3 0 auto; + overflow-y: auto; + + &--header { + padding: 2rem 1rem 0 3rem; + } + } + .demo &__nav { + grid-area: menu; + + position: unset; + + visibility: visible; + box-shadow: none; + + width: unset; + + margin: 0; + padding: 2.4rem 3rem 0 1rem; + + flex: 1 0 auto; + overflow-y: auto; + } + + &__footer { + grid-area: footer; + } + } +} + +@media (min-width: 1220px) { +} + +@media (min-width: 1360px) { +} diff --git a/examples/scss/styles.scss b/examples/scss/styles.scss new file mode 100644 index 0000000..cd756d8 --- /dev/null +++ b/examples/scss/styles.scss @@ -0,0 +1,302 @@ +/* + +Colors + + "#eceff4" + + #d8dee9" + + "#8ca9cd" + + "#5e81ac" links + + "#3f6593" + + "#2e3440" + + + colorful + + "#88c0d0" + + "#8fbcbb" + + + + + "gainsboro" + + +*/ + +*, +:after, +:before { + box-sizing: border-box; +} + +html { + font-family: Work Sans, sans-serif; + font-size: 100%; + color: #4c566a; +} + +body { + padding: 0; + margin: 0; + + text-rendering: optimizeSpeed; + + display: flex; + min-height: 95vh; + flex-direction: column; + + line-height: 1.5; +} + +a { + color: #5e81ac; + text-decoration: none; +} + +h1, +h2 { + padding: 0; + margin: 0; +} + +ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +li { + margin: 0; + padding: 0; +} + +pre { + margin: 0; +} + +h1 { + color: #2e3440; +} + +.hljs { + white-space: pre-wrap; + padding: 2rem 1rem; +} + +.dnd { + $max-width: 1100px; + + &__nav { + position: sticky; + top: 0; + left: 0; + + padding: 1rem; + + display: flex; + align-items: center; + + background-color: #ffffff; + border-bottom: 1px solid #eceff4; + + &--brand { + margin-right: auto; + } + + &--icon { + margin-left: 1rem; + + display: block; + + width: 1.3rem; + height: 1.3rem; + + color: #5e81ac; + + &:hover { + cursor: pointer; + } + + .home &.menu { + display: none; + } + } + } + + &__home { + padding: 0 1rem; + + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + flex: 1 1 auto; + + &--intro { + text-align: center; + + &--name { + margin: 0 0 2rem 0; + font-size: 2.8rem; + } + + &--description { + font-size: 1.2rem; + } + } + + &--chapters { + &--chapter { + margin: 2rem 0 0 0; + + &--title { + } + &--nav { + &--link { + display: block; + } + } + } + } + } + + &__demo { + &--content { + &--intro { + &--title { + display: flex; + align-items: center; + + &--text { + font-size: 2.2rem; + } + + &--link { + display: flex; + margin-left: auto; + + &--icon { + display: block; + + width: 1.3rem; + height: 1.3rem; + + color: #5e81ac; + } + } + } + } + } + + &--chapters { + display: none; + + &.show { + display: block; + } + } + } + + &__footer { + padding: 1rem; + + margin-bottom: -5vh; + + display: flex; + align-items: center; + justify-content: center; + + text-align: center; + + font-size: smaller; + } +} + +@media (min-width: 480px) { +} + +@media (min-width: 600px) { +} + +@media (min-width: 700px) { +} + +@media (min-width: 1000px) { + .dnd { + &__nav { + &--icon.menu { + display: none; + } + } + + &__home { + &--chapters { + display: flex; + } + } + + &__demo { + display: flex; + + &--chapters { + order: 1; + display: block; + + width: 20%; + margin-right: 40px; + + &--chapter { + &--nav { + display: flex; + flex-direction: column; + } + } + } + + &--content { + order: 2; + } + } + } +} + +@media (min-width: 1220px) { +} + +@media (min-width: 1360px) { +} +@media (min-width: 640px) { + html { + font-size: 118.75%; + } +} + +@media (min-width: 900px) { + html { + font-size: 125%; + } +} + +@media (min-width: 1100px) { + html { + font-size: 131.25%; + } +} + +@media (min-width: 1800px) { + html { + font-size: 137.5%; + } +} + +@media (min-width: 2800px) { + html { + font-size: 156.25%; + } +} diff --git a/examples/src/Config/Movement/Root.elm b/examples/src/Config/Movement/Root.elm deleted file mode 100755 index 4a2438e..0000000 --- a/examples/src/Config/Movement/Root.elm +++ /dev/null @@ -1,300 +0,0 @@ -module Config.Movement.Root exposing - ( Model - , Msg - , demoView - , init - , initialModel - , subscriptions - , update - , url - , view - ) - -import Config.Movement.FreeOnDrag -import Config.Movement.FreeOnDrop -import Config.Movement.HorizontalOnDrag -import Config.Movement.HorizontalOnDrop -import Config.Movement.VerticalOnDrag -import Config.Movement.VerticalOnDrop -import Html -import Html.Attributes -import Html.Events - - - --- MODEL - - -type alias Model = - { id : Int - , examples : List Example - } - - -type Example - = FreeOnDrag Config.Movement.FreeOnDrag.Model - | FreeOnDrop Config.Movement.FreeOnDrop.Model - | HorizontalOnDrag Config.Movement.HorizontalOnDrag.Model - | HorizontalOnDrop Config.Movement.HorizontalOnDrop.Model - | VerticalOnDrag Config.Movement.VerticalOnDrag.Model - | VerticalOnDrop Config.Movement.VerticalOnDrop.Model - - -initialModel : Model -initialModel = - { id = 0 - , examples = - [ FreeOnDrag Config.Movement.FreeOnDrag.initialModel - , FreeOnDrop Config.Movement.FreeOnDrop.initialModel - , HorizontalOnDrag Config.Movement.HorizontalOnDrag.initialModel - , HorizontalOnDrop Config.Movement.HorizontalOnDrop.initialModel - , VerticalOnDrag Config.Movement.VerticalOnDrag.initialModel - , VerticalOnDrop Config.Movement.VerticalOnDrop.initialModel - ] - } - - -init : () -> ( Model, Cmd Msg ) -init _ = - ( initialModel, Cmd.none ) - - -url : Int -> String -url id = - case id of - 0 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/FreeOnDrag.elm" - - 1 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/FreeOnDrop.elm" - - 2 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/HorizontalOnDrag.elm" - - 3 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/HorizontalOnDrop.elm" - - 4 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/VerticalOnDrag.elm" - - 5 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/Movement/VerticalOnDrop.elm" - - _ -> - "" - - - --- UPDATE - - -type Msg - = LinkClicked Int - | FreeOnDragMsg Config.Movement.FreeOnDrag.Msg - | FreeOnDropMsg Config.Movement.FreeOnDrop.Msg - | HorizontalOnDragMsg Config.Movement.HorizontalOnDrag.Msg - | HorizontalOnDropMsg Config.Movement.HorizontalOnDrop.Msg - | VerticalOnDragMsg Config.Movement.VerticalOnDrag.Msg - | VerticalOnDropMsg Config.Movement.VerticalOnDrop.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - LinkClicked id -> - ( { model | id = id }, Cmd.none ) - - _ -> - model.examples - |> List.map - (\example -> - case ( message, example ) of - ( FreeOnDragMsg msg, FreeOnDrag mo ) -> - stepFreeOnDrag (Config.Movement.FreeOnDrag.update msg mo) - - ( FreeOnDropMsg msg, FreeOnDrop mo ) -> - stepFreeOnDrop (Config.Movement.FreeOnDrop.update msg mo) - - ( HorizontalOnDragMsg msg, HorizontalOnDrag mo ) -> - stepHorizontalOnDrag (Config.Movement.HorizontalOnDrag.update msg mo) - - ( HorizontalOnDropMsg msg, HorizontalOnDrop mo ) -> - stepHorizontalOnDrop (Config.Movement.HorizontalOnDrop.update msg mo) - - ( VerticalOnDragMsg msg, VerticalOnDrag mo ) -> - stepVerticalOnDrag (Config.Movement.VerticalOnDrag.update msg mo) - - ( VerticalOnDropMsg msg, VerticalOnDrop mo ) -> - stepVerticalOnDrop (Config.Movement.VerticalOnDrop.update msg mo) - - _ -> - ( example, Cmd.none ) - ) - |> List.unzip - |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) - - -stepFreeOnDrag : ( Config.Movement.FreeOnDrag.Model, Cmd Config.Movement.FreeOnDrag.Msg ) -> ( Example, Cmd Msg ) -stepFreeOnDrag ( mo, cmds ) = - ( FreeOnDrag mo, Cmd.map FreeOnDragMsg cmds ) - - -stepFreeOnDrop : ( Config.Movement.FreeOnDrop.Model, Cmd Config.Movement.FreeOnDrop.Msg ) -> ( Example, Cmd Msg ) -stepFreeOnDrop ( mo, cmds ) = - ( FreeOnDrop mo, Cmd.map FreeOnDropMsg cmds ) - - -stepHorizontalOnDrag : ( Config.Movement.HorizontalOnDrag.Model, Cmd Config.Movement.HorizontalOnDrag.Msg ) -> ( Example, Cmd Msg ) -stepHorizontalOnDrag ( mo, cmds ) = - ( HorizontalOnDrag mo, Cmd.map HorizontalOnDragMsg cmds ) - - -stepHorizontalOnDrop : ( Config.Movement.HorizontalOnDrop.Model, Cmd Config.Movement.HorizontalOnDrop.Msg ) -> ( Example, Cmd Msg ) -stepHorizontalOnDrop ( mo, cmds ) = - ( HorizontalOnDrop mo, Cmd.map HorizontalOnDropMsg cmds ) - - -stepVerticalOnDrag : ( Config.Movement.VerticalOnDrag.Model, Cmd Config.Movement.VerticalOnDrag.Msg ) -> ( Example, Cmd Msg ) -stepVerticalOnDrag ( mo, cmds ) = - ( VerticalOnDrag mo, Cmd.map VerticalOnDragMsg cmds ) - - -stepVerticalOnDrop : ( Config.Movement.VerticalOnDrop.Model, Cmd Config.Movement.VerticalOnDrop.Msg ) -> ( Example, Cmd Msg ) -stepVerticalOnDrop ( mo, cmds ) = - ( VerticalOnDrop mo, Cmd.map VerticalOnDropMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - model.examples - |> List.map - (\example -> - case example of - FreeOnDrag mo -> - Sub.map FreeOnDragMsg (Config.Movement.FreeOnDrag.subscriptions mo) - - FreeOnDrop mo -> - Sub.map FreeOnDropMsg (Config.Movement.FreeOnDrop.subscriptions mo) - - HorizontalOnDrag mo -> - Sub.map HorizontalOnDragMsg (Config.Movement.HorizontalOnDrag.subscriptions mo) - - HorizontalOnDrop mo -> - Sub.map HorizontalOnDropMsg (Config.Movement.HorizontalOnDrop.subscriptions mo) - - VerticalOnDrag mo -> - Sub.map VerticalOnDragMsg (Config.Movement.VerticalOnDrag.subscriptions mo) - - VerticalOnDrop mo -> - Sub.map VerticalOnDropMsg (Config.Movement.VerticalOnDrop.subscriptions mo) - ) - |> Sub.batch - - - --- VIEW - - -view : Model -> Html.Html Msg -view model = - Html.div [] - [ model.examples - |> List.take 2 - |> List.indexedMap (demoWrapperView 0 model.id) - |> Html.section - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "flex-wrap" "wrap" - , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "padding-top" "2em" - ] - , model.examples - |> List.drop 2 - |> List.take 2 - |> List.indexedMap (demoWrapperView 2 model.id) - |> Html.section [] - , model.examples - |> List.drop 4 - |> List.take 2 - |> List.indexedMap (demoWrapperView 4 model.id) - |> Html.section - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "justify-content" "center" - ] - ] - - -demoWrapperView : Int -> Int -> Int -> Example -> Html.Html Msg -demoWrapperView offset currentId id example = - let - globalId : Int - globalId = - offset + id - in - Html.div - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "margin" "4em 0" - ] - [ demoView example - , Html.div - [ Html.Attributes.classList [ ( "link", True ), ( "is-active", globalId == currentId ) ] - , Html.Events.onClick (LinkClicked globalId) - ] - [ Html.text (info example) ] - ] - - -demoView : Example -> Html.Html Msg -demoView example = - case example of - FreeOnDrag mo -> - Html.map FreeOnDragMsg (Config.Movement.FreeOnDrag.view mo) - - FreeOnDrop mo -> - Html.map FreeOnDropMsg (Config.Movement.FreeOnDrop.view mo) - - HorizontalOnDrag mo -> - Html.map HorizontalOnDragMsg (Config.Movement.HorizontalOnDrag.view mo) - - HorizontalOnDrop mo -> - Html.map HorizontalOnDropMsg (Config.Movement.HorizontalOnDrop.view mo) - - VerticalOnDrag mo -> - Html.map VerticalOnDragMsg (Config.Movement.VerticalOnDrag.view mo) - - VerticalOnDrop mo -> - Html.map VerticalOnDropMsg (Config.Movement.VerticalOnDrop.view mo) - - - --- EXAMPLE INFO - - -type alias Info = - String - - -info : Example -> Info -info example = - case example of - FreeOnDrag _ -> - "Free on drag" - - FreeOnDrop _ -> - "Free on drop" - - HorizontalOnDrag _ -> - "Horizontal on drag" - - HorizontalOnDrop _ -> - "Horizontal on drop" - - VerticalOnDrag _ -> - "Vertical on drag" - - VerticalOnDrop _ -> - "Vertical on drop" diff --git a/examples/src/Config/OperationsOnDrag/Root.elm b/examples/src/Config/OperationsOnDrag/Root.elm deleted file mode 100755 index f637552..0000000 --- a/examples/src/Config/OperationsOnDrag/Root.elm +++ /dev/null @@ -1,251 +0,0 @@ -module Config.OperationsOnDrag.Root exposing - ( Model - , Msg - , demoView - , init - , initialModel - , subscriptions - , update - , url - , view - ) - -import Config.OperationsOnDrag.InsertAfter -import Config.OperationsOnDrag.InsertBefore -import Config.OperationsOnDrag.Rotate -import Config.OperationsOnDrag.Swap -import Config.OperationsOnDrag.Unaltered -import Html -import Html.Attributes -import Html.Events - - - --- MODEL - - -type alias Model = - { id : Int - , examples : List Example - } - - -type Example - = InsertAfter Config.OperationsOnDrag.InsertAfter.Model - | InsertBefore Config.OperationsOnDrag.InsertBefore.Model - | Rotate Config.OperationsOnDrag.Rotate.Model - | Swap Config.OperationsOnDrag.Swap.Model - | Unaltered Config.OperationsOnDrag.Unaltered.Model - - -initialModel : Model -initialModel = - { id = 0 - , examples = - [ InsertAfter Config.OperationsOnDrag.InsertAfter.initialModel - , InsertBefore Config.OperationsOnDrag.InsertBefore.initialModel - , Rotate Config.OperationsOnDrag.Rotate.initialModel - , Swap Config.OperationsOnDrag.Swap.initialModel - , Unaltered Config.OperationsOnDrag.Unaltered.initialModel - ] - } - - -init : () -> ( Model, Cmd Msg ) -init _ = - ( initialModel, Cmd.none ) - - -url : Int -> String -url id = - case id of - 0 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/InsertAfter.elm" - - 1 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/InsertBefore.elm" - - 2 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/Rotate.elm" - - 3 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/Swap.elm" - - 4 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrag/Unaltered.elm" - - _ -> - "" - - - --- UPDATE - - -type Msg - = LinkClicked Int - | InsertAfterMsg Config.OperationsOnDrag.InsertAfter.Msg - | InsertBeforeMsg Config.OperationsOnDrag.InsertBefore.Msg - | RotateMsg Config.OperationsOnDrag.Rotate.Msg - | SwapMsg Config.OperationsOnDrag.Swap.Msg - | UnalteredMsg Config.OperationsOnDrag.Unaltered.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - LinkClicked id -> - ( { model | id = id }, Cmd.none ) - - _ -> - model.examples - |> List.map - (\example -> - case ( message, example ) of - ( InsertAfterMsg msg, InsertAfter mo ) -> - stepInsertAfter (Config.OperationsOnDrag.InsertAfter.update msg mo) - - ( InsertBeforeMsg msg, InsertBefore mo ) -> - stepInsertBefore (Config.OperationsOnDrag.InsertBefore.update msg mo) - - ( RotateMsg msg, Rotate mo ) -> - stepRotate (Config.OperationsOnDrag.Rotate.update msg mo) - - ( SwapMsg msg, Swap mo ) -> - stepSwap (Config.OperationsOnDrag.Swap.update msg mo) - - ( UnalteredMsg msg, Unaltered mo ) -> - stepUnaltered (Config.OperationsOnDrag.Unaltered.update msg mo) - - _ -> - ( example, Cmd.none ) - ) - |> List.unzip - |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) - - -stepInsertAfter : ( Config.OperationsOnDrag.InsertAfter.Model, Cmd Config.OperationsOnDrag.InsertAfter.Msg ) -> ( Example, Cmd Msg ) -stepInsertAfter ( mo, cmds ) = - ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) - - -stepInsertBefore : ( Config.OperationsOnDrag.InsertBefore.Model, Cmd Config.OperationsOnDrag.InsertBefore.Msg ) -> ( Example, Cmd Msg ) -stepInsertBefore ( mo, cmds ) = - ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) - - -stepRotate : ( Config.OperationsOnDrag.Rotate.Model, Cmd Config.OperationsOnDrag.Rotate.Msg ) -> ( Example, Cmd Msg ) -stepRotate ( mo, cmds ) = - ( Rotate mo, Cmd.map RotateMsg cmds ) - - -stepSwap : ( Config.OperationsOnDrag.Swap.Model, Cmd Config.OperationsOnDrag.Swap.Msg ) -> ( Example, Cmd Msg ) -stepSwap ( mo, cmds ) = - ( Swap mo, Cmd.map SwapMsg cmds ) - - -stepUnaltered : ( Config.OperationsOnDrag.Unaltered.Model, Cmd Config.OperationsOnDrag.Unaltered.Msg ) -> ( Example, Cmd Msg ) -stepUnaltered ( mo, cmds ) = - ( Unaltered mo, Cmd.map UnalteredMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - model.examples - |> List.map - (\example -> - case example of - InsertAfter mo -> - Sub.map InsertAfterMsg (Config.OperationsOnDrag.InsertAfter.subscriptions mo) - - InsertBefore mo -> - Sub.map InsertBeforeMsg (Config.OperationsOnDrag.InsertBefore.subscriptions mo) - - Rotate mo -> - Sub.map RotateMsg (Config.OperationsOnDrag.Rotate.subscriptions mo) - - Swap mo -> - Sub.map SwapMsg (Config.OperationsOnDrag.Swap.subscriptions mo) - - Unaltered mo -> - Sub.map UnalteredMsg (Config.OperationsOnDrag.Unaltered.subscriptions mo) - ) - |> Sub.batch - - - --- VIEW - - -view : Model -> Html.Html Msg -view model = - model.examples - |> List.indexedMap (demoWrapperView model.id) - |> Html.section [] - - -demoWrapperView : Int -> Int -> Example -> Html.Html Msg -demoWrapperView currentId id example = - Html.div - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "flex-wrap" "wrap" - , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "margin" "4em 0" - ] - [ demoView example - , Html.div - [ Html.Attributes.classList [ ( "link", True ), ( "is-active", id == currentId ) ] - , Html.Events.onClick (LinkClicked id) - ] - [ Html.text (info example) ] - ] - - -demoView : Example -> Html.Html Msg -demoView example = - case example of - InsertAfter mo -> - Html.map InsertAfterMsg (Config.OperationsOnDrag.InsertAfter.view mo) - - InsertBefore mo -> - Html.map InsertBeforeMsg (Config.OperationsOnDrag.InsertBefore.view mo) - - Rotate mo -> - Html.map RotateMsg (Config.OperationsOnDrag.Rotate.view mo) - - Swap mo -> - Html.map SwapMsg (Config.OperationsOnDrag.Swap.view mo) - - Unaltered mo -> - Html.map UnalteredMsg (Config.OperationsOnDrag.Unaltered.view mo) - - - --- EXAMPLE INFO - - -type alias Info = - String - - -info : Example -> Info -info example = - case example of - InsertAfter _ -> - "Insert after" - - InsertBefore _ -> - "Insert before" - - Rotate _ -> - "Rotate" - - Swap _ -> - "Swap" - - Unaltered _ -> - "Unaltered" diff --git a/examples/src/Config/OperationsOnDrop/Root.elm b/examples/src/Config/OperationsOnDrop/Root.elm deleted file mode 100755 index 2387cf3..0000000 --- a/examples/src/Config/OperationsOnDrop/Root.elm +++ /dev/null @@ -1,251 +0,0 @@ -module Config.OperationsOnDrop.Root exposing - ( Model - , Msg - , demoView - , init - , initialModel - , subscriptions - , update - , url - , view - ) - -import Config.OperationsOnDrop.InsertAfter -import Config.OperationsOnDrop.InsertBefore -import Config.OperationsOnDrop.Rotate -import Config.OperationsOnDrop.Swap -import Config.OperationsOnDrop.Unaltered -import Html -import Html.Attributes -import Html.Events - - - --- MODEL - - -type alias Model = - { id : Int - , examples : List Example - } - - -type Example - = InsertAfter Config.OperationsOnDrop.InsertAfter.Model - | InsertBefore Config.OperationsOnDrop.InsertBefore.Model - | Rotate Config.OperationsOnDrop.Rotate.Model - | Swap Config.OperationsOnDrop.Swap.Model - | Unaltered Config.OperationsOnDrop.Unaltered.Model - - -initialModel : Model -initialModel = - { id = 0 - , examples = - [ InsertAfter Config.OperationsOnDrop.InsertAfter.initialModel - , InsertBefore Config.OperationsOnDrop.InsertBefore.initialModel - , Rotate Config.OperationsOnDrop.Rotate.initialModel - , Swap Config.OperationsOnDrop.Swap.initialModel - , Unaltered Config.OperationsOnDrop.Unaltered.initialModel - ] - } - - -init : () -> ( Model, Cmd Msg ) -init _ = - ( initialModel, Cmd.none ) - - -url : Int -> String -url id = - case id of - 0 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/InsertAfter.elm" - - 1 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/InsertBefore.elm" - - 2 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/Rotate.elm" - - 3 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/Swap.elm" - - 4 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Config/OperationsOnDrop/Unaltered.elm" - - _ -> - "" - - - --- UPDATE - - -type Msg - = LinkClicked Int - | InsertAfterMsg Config.OperationsOnDrop.InsertAfter.Msg - | InsertBeforeMsg Config.OperationsOnDrop.InsertBefore.Msg - | RotateMsg Config.OperationsOnDrop.Rotate.Msg - | SwapMsg Config.OperationsOnDrop.Swap.Msg - | UnalteredMsg Config.OperationsOnDrop.Unaltered.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - LinkClicked id -> - ( { model | id = id }, Cmd.none ) - - _ -> - model.examples - |> List.map - (\example -> - case ( message, example ) of - ( InsertAfterMsg msg, InsertAfter mo ) -> - stepInsertAfter (Config.OperationsOnDrop.InsertAfter.update msg mo) - - ( InsertBeforeMsg msg, InsertBefore mo ) -> - stepInsertBefore (Config.OperationsOnDrop.InsertBefore.update msg mo) - - ( RotateMsg msg, Rotate mo ) -> - stepRotate (Config.OperationsOnDrop.Rotate.update msg mo) - - ( SwapMsg msg, Swap mo ) -> - stepSwap (Config.OperationsOnDrop.Swap.update msg mo) - - ( UnalteredMsg msg, Unaltered mo ) -> - stepUnaltered (Config.OperationsOnDrop.Unaltered.update msg mo) - - _ -> - ( example, Cmd.none ) - ) - |> List.unzip - |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) - - -stepInsertAfter : ( Config.OperationsOnDrop.InsertAfter.Model, Cmd Config.OperationsOnDrop.InsertAfter.Msg ) -> ( Example, Cmd Msg ) -stepInsertAfter ( mo, cmds ) = - ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) - - -stepInsertBefore : ( Config.OperationsOnDrop.InsertBefore.Model, Cmd Config.OperationsOnDrop.InsertBefore.Msg ) -> ( Example, Cmd Msg ) -stepInsertBefore ( mo, cmds ) = - ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) - - -stepRotate : ( Config.OperationsOnDrop.Rotate.Model, Cmd Config.OperationsOnDrop.Rotate.Msg ) -> ( Example, Cmd Msg ) -stepRotate ( mo, cmds ) = - ( Rotate mo, Cmd.map RotateMsg cmds ) - - -stepSwap : ( Config.OperationsOnDrop.Swap.Model, Cmd Config.OperationsOnDrop.Swap.Msg ) -> ( Example, Cmd Msg ) -stepSwap ( mo, cmds ) = - ( Swap mo, Cmd.map SwapMsg cmds ) - - -stepUnaltered : ( Config.OperationsOnDrop.Unaltered.Model, Cmd Config.OperationsOnDrop.Unaltered.Msg ) -> ( Example, Cmd Msg ) -stepUnaltered ( mo, cmds ) = - ( Unaltered mo, Cmd.map UnalteredMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - model.examples - |> List.map - (\example -> - case example of - InsertAfter mo -> - Sub.map InsertAfterMsg (Config.OperationsOnDrop.InsertAfter.subscriptions mo) - - InsertBefore mo -> - Sub.map InsertBeforeMsg (Config.OperationsOnDrop.InsertBefore.subscriptions mo) - - Rotate mo -> - Sub.map RotateMsg (Config.OperationsOnDrop.Rotate.subscriptions mo) - - Swap mo -> - Sub.map SwapMsg (Config.OperationsOnDrop.Swap.subscriptions mo) - - Unaltered mo -> - Sub.map UnalteredMsg (Config.OperationsOnDrop.Unaltered.subscriptions mo) - ) - |> Sub.batch - - - --- VIEW - - -view : Model -> Html.Html Msg -view model = - model.examples - |> List.indexedMap (demoWrapperView model.id) - |> Html.section [] - - -demoWrapperView : Int -> Int -> Example -> Html.Html Msg -demoWrapperView currentId id example = - Html.div - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "flex-wrap" "wrap" - , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "margin" "4em 0" - ] - [ demoView example - , Html.div - [ Html.Attributes.classList [ ( "link", True ), ( "is-active", id == currentId ) ] - , Html.Events.onClick (LinkClicked id) - ] - [ Html.text (info example) ] - ] - - -demoView : Example -> Html.Html Msg -demoView example = - case example of - InsertAfter mo -> - Html.map InsertAfterMsg (Config.OperationsOnDrop.InsertAfter.view mo) - - InsertBefore mo -> - Html.map InsertBeforeMsg (Config.OperationsOnDrop.InsertBefore.view mo) - - Rotate mo -> - Html.map RotateMsg (Config.OperationsOnDrop.Rotate.view mo) - - Swap mo -> - Html.map SwapMsg (Config.OperationsOnDrop.Swap.view mo) - - Unaltered mo -> - Html.map UnalteredMsg (Config.OperationsOnDrop.Unaltered.view mo) - - - --- EXAMPLE INFO - - -type alias Info = - String - - -info : Example -> Info -info example = - case example of - InsertAfter _ -> - "Insert after" - - InsertBefore _ -> - "Insert before" - - Rotate _ -> - "Rotate" - - Swap _ -> - "Swap" - - Unaltered _ -> - "Unaltered" diff --git a/examples/src/Config/Root.elm b/examples/src/Config/Root.elm deleted file mode 100755 index 1fd8238..0000000 --- a/examples/src/Config/Root.elm +++ /dev/null @@ -1,228 +0,0 @@ -module Config.Root exposing - ( Model - , Msg - , codeView - , demoView - , headerView - , init - , navigationView - , subscriptions - , update - ) - -import Config.Movement.Root -import Config.OperationsOnDrag.Root -import Config.OperationsOnDrop.Root -import CustomElement -import Html -import Html.Attributes -import Path -import Url.Builder - - - --- MODEL - - -type alias Model = - Example - - -type Example - = Movement Config.Movement.Root.Model - | OperationsOnDrag Config.OperationsOnDrag.Root.Model - | OperationsOnDrop Config.OperationsOnDrop.Root.Model - - -init : String -> ( Model, Cmd Msg ) -init slug = - ( toExample slug, Cmd.none ) - - - --- UPDATE - - -type Msg - = MovementMsg Config.Movement.Root.Msg - | OperationsOnDragMsg Config.OperationsOnDrag.Root.Msg - | OperationsOnDropMsg Config.OperationsOnDrop.Root.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case ( message, model ) of - ( MovementMsg msg, Movement mo ) -> - stepMovement (Config.Movement.Root.update msg mo) - - ( OperationsOnDragMsg msg, OperationsOnDrag mo ) -> - stepOperationsOnDrag (Config.OperationsOnDrag.Root.update msg mo) - - ( OperationsOnDropMsg msg, OperationsOnDrop mo ) -> - stepOperationsOnDrop (Config.OperationsOnDrop.Root.update msg mo) - - _ -> - ( model, Cmd.none ) - - -stepMovement : ( Config.Movement.Root.Model, Cmd Config.Movement.Root.Msg ) -> ( Model, Cmd Msg ) -stepMovement ( mo, cmds ) = - ( Movement mo, Cmd.map MovementMsg cmds ) - - -stepOperationsOnDrag : ( Config.OperationsOnDrag.Root.Model, Cmd Config.OperationsOnDrag.Root.Msg ) -> ( Model, Cmd Msg ) -stepOperationsOnDrag ( mo, cmds ) = - ( OperationsOnDrag mo, Cmd.map OperationsOnDragMsg cmds ) - - -stepOperationsOnDrop : ( Config.OperationsOnDrop.Root.Model, Cmd Config.OperationsOnDrop.Root.Msg ) -> ( Model, Cmd Msg ) -stepOperationsOnDrop ( mo, cmds ) = - ( OperationsOnDrop mo, Cmd.map OperationsOnDropMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - case model of - Movement mo -> - Sub.map MovementMsg (Config.Movement.Root.subscriptions mo) - - OperationsOnDrag mo -> - Sub.map OperationsOnDragMsg (Config.OperationsOnDrag.Root.subscriptions mo) - - OperationsOnDrop mo -> - Sub.map OperationsOnDropMsg (Config.OperationsOnDrop.Root.subscriptions mo) - - - --- VIEW - - -navigationView : String -> Html.Html Msg -navigationView currentPath = - Html.div - [ Html.Attributes.class "navigation" ] - [ Html.h4 [] [ Html.text "DnDList" ] - , [ Movement Config.Movement.Root.initialModel - , OperationsOnDrag Config.OperationsOnDrag.Root.initialModel - , OperationsOnDrop Config.OperationsOnDrop.Root.initialModel - ] - |> List.map (linkView currentPath) - |> Html.ul [] - ] - - -linkView : String -> Example -> Html.Html Msg -linkView currentPath example = - let - path : String - path = - Url.Builder.absolute [ Path.rootPath, "config", (info >> .slug) example ] [] - in - Html.li [] - [ Html.a - [ Html.Attributes.classList [ ( "is-active", path == currentPath ) ] - , Html.Attributes.href path - ] - [ Html.text ((info >> .title) example) ] - ] - - -headerView : Model -> Html.Html Msg -headerView model = - let - title : String - title = - (info >> .title) model - - description : String - description = - (info >> .description) model - in - Html.header [] - [ Html.h2 [] [ Html.text title ] - , Html.p [] [ Html.text description ] - ] - - -demoView : Model -> Html.Html Msg -demoView model = - case model of - Movement mo -> - Html.map MovementMsg (Config.Movement.Root.view mo) - - OperationsOnDrag mo -> - Html.map OperationsOnDragMsg (Config.OperationsOnDrag.Root.view mo) - - OperationsOnDrop mo -> - Html.map OperationsOnDropMsg (Config.OperationsOnDrop.Root.view mo) - - -codeView : Model -> Html.Html Msg -codeView model = - case model of - Movement mo -> - toCode (Config.Movement.Root.url mo.id) - - OperationsOnDrag mo -> - toCode (Config.OperationsOnDrag.Root.url mo.id) - - OperationsOnDrop mo -> - toCode (Config.OperationsOnDrop.Root.url mo.id) - - -toCode : String -> Html.Html msg -toCode url = - CustomElement.elmCode [ CustomElement.href url ] [] - - - --- EXAMPLE INFO - - -toExample : String -> Example -toExample slug = - case slug of - "movement" -> - Movement Config.Movement.Root.initialModel - - "operations-drag" -> - OperationsOnDrag Config.OperationsOnDrag.Root.initialModel - - "operations-drop" -> - OperationsOnDrop Config.OperationsOnDrop.Root.initialModel - - _ -> - Movement Config.Movement.Root.initialModel - - -type alias Info = - { slug : String - , title : String - , description : String - } - - -info : Example -> Info -info example = - case example of - Movement _ -> - { slug = "movement" - , title = "Movement" - , description = "The behavior of the Free, Horizontal only and Vertical only drag movements with Swap list operation." - } - - OperationsOnDrag _ -> - { slug = "operations-drag" - , title = "Operations on drag" - , description = "Compare the list operations sorting on drag." - } - - OperationsOnDrop _ -> - { slug = "operations-drop" - , title = "Operations on drop" - , description = "Compare the list operations sorting on drop." - } diff --git a/examples/src/ConfigGroups/OperationsOnDrag/Root.elm b/examples/src/ConfigGroups/OperationsOnDrag/Root.elm deleted file mode 100755 index 581a1f4..0000000 --- a/examples/src/ConfigGroups/OperationsOnDrag/Root.elm +++ /dev/null @@ -1,227 +0,0 @@ -module ConfigGroups.OperationsOnDrag.Root exposing - ( Model - , Msg - , demoView - , init - , initialModel - , subscriptions - , update - , url - , view - ) - -import ConfigGroups.OperationsOnDrag.InsertAfter -import ConfigGroups.OperationsOnDrag.InsertBefore -import ConfigGroups.OperationsOnDrag.Rotate -import ConfigGroups.OperationsOnDrag.Swap -import Html -import Html.Attributes -import Html.Events - - - --- MODEL - - -type alias Model = - { id : Int - , examples : List Example - } - - -type Example - = InsertAfter ConfigGroups.OperationsOnDrag.InsertAfter.Model - | InsertBefore ConfigGroups.OperationsOnDrag.InsertBefore.Model - | Rotate ConfigGroups.OperationsOnDrag.Rotate.Model - | Swap ConfigGroups.OperationsOnDrag.Swap.Model - - -initialModel : Model -initialModel = - { id = 0 - , examples = - [ InsertAfter ConfigGroups.OperationsOnDrag.InsertAfter.initialModel - , InsertBefore ConfigGroups.OperationsOnDrag.InsertBefore.initialModel - , Rotate ConfigGroups.OperationsOnDrag.Rotate.initialModel - , Swap ConfigGroups.OperationsOnDrag.Swap.initialModel - ] - } - - -init : () -> ( Model, Cmd Msg ) -init _ = - ( initialModel, Cmd.none ) - - -url : Int -> String -url id = - case id of - 0 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/InsertAfter.elm" - - 1 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/InsertBefore.elm" - - 2 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/Rotate.elm" - - 3 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrag/Swap.elm" - - _ -> - "" - - - --- UPDATE - - -type Msg - = LinkClicked Int - | InsertAfterMsg ConfigGroups.OperationsOnDrag.InsertAfter.Msg - | InsertBeforeMsg ConfigGroups.OperationsOnDrag.InsertBefore.Msg - | RotateMsg ConfigGroups.OperationsOnDrag.Rotate.Msg - | SwapMsg ConfigGroups.OperationsOnDrag.Swap.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - LinkClicked id -> - ( { model | id = id }, Cmd.none ) - - _ -> - model.examples - |> List.map - (\example -> - case ( message, example ) of - ( InsertAfterMsg msg, InsertAfter mo ) -> - stepInsertAfter (ConfigGroups.OperationsOnDrag.InsertAfter.update msg mo) - - ( InsertBeforeMsg msg, InsertBefore mo ) -> - stepInsertBefore (ConfigGroups.OperationsOnDrag.InsertBefore.update msg mo) - - ( RotateMsg msg, Rotate mo ) -> - stepRotate (ConfigGroups.OperationsOnDrag.Rotate.update msg mo) - - ( SwapMsg msg, Swap mo ) -> - stepSwap (ConfigGroups.OperationsOnDrag.Swap.update msg mo) - - _ -> - ( example, Cmd.none ) - ) - |> List.unzip - |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) - - -stepInsertAfter : ( ConfigGroups.OperationsOnDrag.InsertAfter.Model, Cmd ConfigGroups.OperationsOnDrag.InsertAfter.Msg ) -> ( Example, Cmd Msg ) -stepInsertAfter ( mo, cmds ) = - ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) - - -stepInsertBefore : ( ConfigGroups.OperationsOnDrag.InsertBefore.Model, Cmd ConfigGroups.OperationsOnDrag.InsertBefore.Msg ) -> ( Example, Cmd Msg ) -stepInsertBefore ( mo, cmds ) = - ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) - - -stepRotate : ( ConfigGroups.OperationsOnDrag.Rotate.Model, Cmd ConfigGroups.OperationsOnDrag.Rotate.Msg ) -> ( Example, Cmd Msg ) -stepRotate ( mo, cmds ) = - ( Rotate mo, Cmd.map RotateMsg cmds ) - - -stepSwap : ( ConfigGroups.OperationsOnDrag.Swap.Model, Cmd ConfigGroups.OperationsOnDrag.Swap.Msg ) -> ( Example, Cmd Msg ) -stepSwap ( mo, cmds ) = - ( Swap mo, Cmd.map SwapMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - model.examples - |> List.map - (\example -> - case example of - InsertAfter mo -> - Sub.map InsertAfterMsg (ConfigGroups.OperationsOnDrag.InsertAfter.subscriptions mo) - - InsertBefore mo -> - Sub.map InsertBeforeMsg (ConfigGroups.OperationsOnDrag.InsertBefore.subscriptions mo) - - Rotate mo -> - Sub.map RotateMsg (ConfigGroups.OperationsOnDrag.Rotate.subscriptions mo) - - Swap mo -> - Sub.map SwapMsg (ConfigGroups.OperationsOnDrag.Swap.subscriptions mo) - ) - |> Sub.batch - - - --- VIEW - - -view : Model -> Html.Html Msg -view model = - model.examples - |> List.indexedMap (demoWrapperView model.id) - |> Html.section [] - - -demoWrapperView : Int -> Int -> Example -> Html.Html Msg -demoWrapperView currentId id example = - Html.div - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "flex-wrap" "wrap" - , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "margin" "4em 0" - ] - [ demoView example - , Html.div - [ Html.Attributes.classList [ ( "link", True ), ( "is-active", id == currentId ) ] - , Html.Events.onClick (LinkClicked id) - ] - [ Html.text (info example) ] - ] - - -demoView : Example -> Html.Html Msg -demoView example = - case example of - InsertAfter mo -> - Html.map InsertAfterMsg (ConfigGroups.OperationsOnDrag.InsertAfter.view mo) - - InsertBefore mo -> - Html.map InsertBeforeMsg (ConfigGroups.OperationsOnDrag.InsertBefore.view mo) - - Rotate mo -> - Html.map RotateMsg (ConfigGroups.OperationsOnDrag.Rotate.view mo) - - Swap mo -> - Html.map SwapMsg (ConfigGroups.OperationsOnDrag.Swap.view mo) - - - --- EXAMPLE INFO - - -type alias Info = - String - - -info : Example -> Info -info example = - case example of - InsertAfter _ -> - "Insert after" - - InsertBefore _ -> - "Insert before" - - Rotate _ -> - "Rotate" - - Swap _ -> - "Swap" diff --git a/examples/src/ConfigGroups/OperationsOnDrop/Root.elm b/examples/src/ConfigGroups/OperationsOnDrop/Root.elm deleted file mode 100755 index 821dd90..0000000 --- a/examples/src/ConfigGroups/OperationsOnDrop/Root.elm +++ /dev/null @@ -1,227 +0,0 @@ -module ConfigGroups.OperationsOnDrop.Root exposing - ( Model - , Msg - , demoView - , init - , initialModel - , subscriptions - , update - , url - , view - ) - -import ConfigGroups.OperationsOnDrop.InsertAfter -import ConfigGroups.OperationsOnDrop.InsertBefore -import ConfigGroups.OperationsOnDrop.Rotate -import ConfigGroups.OperationsOnDrop.Swap -import Html -import Html.Attributes -import Html.Events - - - --- MODEL - - -type alias Model = - { id : Int - , examples : List Example - } - - -type Example - = InsertAfter ConfigGroups.OperationsOnDrop.InsertAfter.Model - | InsertBefore ConfigGroups.OperationsOnDrop.InsertBefore.Model - | Rotate ConfigGroups.OperationsOnDrop.Rotate.Model - | Swap ConfigGroups.OperationsOnDrop.Swap.Model - - -initialModel : Model -initialModel = - { id = 0 - , examples = - [ InsertAfter ConfigGroups.OperationsOnDrop.InsertAfter.initialModel - , InsertBefore ConfigGroups.OperationsOnDrop.InsertBefore.initialModel - , Rotate ConfigGroups.OperationsOnDrop.Rotate.initialModel - , Swap ConfigGroups.OperationsOnDrop.Swap.initialModel - ] - } - - -init : () -> ( Model, Cmd Msg ) -init _ = - ( initialModel, Cmd.none ) - - -url : Int -> String -url id = - case id of - 0 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/InsertAfter.elm" - - 1 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/InsertBefore.elm" - - 2 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/Rotate.elm" - - 3 -> - "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/ConfigGroups/OperationsOnDrop/Swap.elm" - - _ -> - "" - - - --- UPDATE - - -type Msg - = LinkClicked Int - | InsertAfterMsg ConfigGroups.OperationsOnDrop.InsertAfter.Msg - | InsertBeforeMsg ConfigGroups.OperationsOnDrop.InsertBefore.Msg - | RotateMsg ConfigGroups.OperationsOnDrop.Rotate.Msg - | SwapMsg ConfigGroups.OperationsOnDrop.Swap.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - LinkClicked id -> - ( { model | id = id }, Cmd.none ) - - _ -> - model.examples - |> List.map - (\example -> - case ( message, example ) of - ( InsertAfterMsg msg, InsertAfter mo ) -> - stepInsertAfter (ConfigGroups.OperationsOnDrop.InsertAfter.update msg mo) - - ( InsertBeforeMsg msg, InsertBefore mo ) -> - stepInsertBefore (ConfigGroups.OperationsOnDrop.InsertBefore.update msg mo) - - ( RotateMsg msg, Rotate mo ) -> - stepRotate (ConfigGroups.OperationsOnDrop.Rotate.update msg mo) - - ( SwapMsg msg, Swap mo ) -> - stepSwap (ConfigGroups.OperationsOnDrop.Swap.update msg mo) - - _ -> - ( example, Cmd.none ) - ) - |> List.unzip - |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) - - -stepInsertAfter : ( ConfigGroups.OperationsOnDrop.InsertAfter.Model, Cmd ConfigGroups.OperationsOnDrop.InsertAfter.Msg ) -> ( Example, Cmd Msg ) -stepInsertAfter ( mo, cmds ) = - ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) - - -stepInsertBefore : ( ConfigGroups.OperationsOnDrop.InsertBefore.Model, Cmd ConfigGroups.OperationsOnDrop.InsertBefore.Msg ) -> ( Example, Cmd Msg ) -stepInsertBefore ( mo, cmds ) = - ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) - - -stepRotate : ( ConfigGroups.OperationsOnDrop.Rotate.Model, Cmd ConfigGroups.OperationsOnDrop.Rotate.Msg ) -> ( Example, Cmd Msg ) -stepRotate ( mo, cmds ) = - ( Rotate mo, Cmd.map RotateMsg cmds ) - - -stepSwap : ( ConfigGroups.OperationsOnDrop.Swap.Model, Cmd ConfigGroups.OperationsOnDrop.Swap.Msg ) -> ( Example, Cmd Msg ) -stepSwap ( mo, cmds ) = - ( Swap mo, Cmd.map SwapMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - model.examples - |> List.map - (\example -> - case example of - InsertAfter mo -> - Sub.map InsertAfterMsg (ConfigGroups.OperationsOnDrop.InsertAfter.subscriptions mo) - - InsertBefore mo -> - Sub.map InsertBeforeMsg (ConfigGroups.OperationsOnDrop.InsertBefore.subscriptions mo) - - Rotate mo -> - Sub.map RotateMsg (ConfigGroups.OperationsOnDrop.Rotate.subscriptions mo) - - Swap mo -> - Sub.map SwapMsg (ConfigGroups.OperationsOnDrop.Swap.subscriptions mo) - ) - |> Sub.batch - - - --- VIEW - - -view : Model -> Html.Html Msg -view model = - model.examples - |> List.indexedMap (demoWrapperView model.id) - |> Html.section [] - - -demoWrapperView : Int -> Int -> Example -> Html.Html Msg -demoWrapperView currentId id example = - Html.div - [ Html.Attributes.style "display" "flex" - , Html.Attributes.style "flex-wrap" "wrap" - , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "margin" "4em 0" - ] - [ demoView example - , Html.div - [ Html.Attributes.classList [ ( "link", True ), ( "is-active", id == currentId ) ] - , Html.Events.onClick (LinkClicked id) - ] - [ Html.text (info example) ] - ] - - -demoView : Example -> Html.Html Msg -demoView example = - case example of - InsertAfter mo -> - Html.map InsertAfterMsg (ConfigGroups.OperationsOnDrop.InsertAfter.view mo) - - InsertBefore mo -> - Html.map InsertBeforeMsg (ConfigGroups.OperationsOnDrop.InsertBefore.view mo) - - Rotate mo -> - Html.map RotateMsg (ConfigGroups.OperationsOnDrop.Rotate.view mo) - - Swap mo -> - Html.map SwapMsg (ConfigGroups.OperationsOnDrop.Swap.view mo) - - - --- EXAMPLE INFO - - -type alias Info = - String - - -info : Example -> Info -info example = - case example of - InsertAfter _ -> - "Insert after" - - InsertBefore _ -> - "Insert before" - - Rotate _ -> - "Rotate" - - Swap _ -> - "Swap" diff --git a/examples/src/ConfigGroups/Root.elm b/examples/src/ConfigGroups/Root.elm deleted file mode 100755 index 1ae35a9..0000000 --- a/examples/src/ConfigGroups/Root.elm +++ /dev/null @@ -1,198 +0,0 @@ -module ConfigGroups.Root exposing - ( Model - , Msg - , codeView - , demoView - , headerView - , init - , navigationView - , subscriptions - , update - ) - -import ConfigGroups.OperationsOnDrag.Root -import ConfigGroups.OperationsOnDrop.Root -import CustomElement -import Html -import Html.Attributes -import Path -import Url.Builder - - - --- MODEL - - -type alias Model = - Example - - -type Example - = OperationsOnDrag ConfigGroups.OperationsOnDrag.Root.Model - | OperationsOnDrop ConfigGroups.OperationsOnDrop.Root.Model - - -init : String -> ( Model, Cmd Msg ) -init slug = - ( toExample slug, Cmd.none ) - - - --- UPDATE - - -type Msg - = OperationsOnDragMsg ConfigGroups.OperationsOnDrag.Root.Msg - | OperationsOnDropMsg ConfigGroups.OperationsOnDrop.Root.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case ( message, model ) of - ( OperationsOnDragMsg msg, OperationsOnDrag mo ) -> - stepOperationsOnDrag (ConfigGroups.OperationsOnDrag.Root.update msg mo) - - ( OperationsOnDropMsg msg, OperationsOnDrop mo ) -> - stepOperationsOnDrop (ConfigGroups.OperationsOnDrop.Root.update msg mo) - - _ -> - ( model, Cmd.none ) - - -stepOperationsOnDrag : ( ConfigGroups.OperationsOnDrag.Root.Model, Cmd ConfigGroups.OperationsOnDrag.Root.Msg ) -> ( Model, Cmd Msg ) -stepOperationsOnDrag ( mo, cmds ) = - ( OperationsOnDrag mo, Cmd.map OperationsOnDragMsg cmds ) - - -stepOperationsOnDrop : ( ConfigGroups.OperationsOnDrop.Root.Model, Cmd ConfigGroups.OperationsOnDrop.Root.Msg ) -> ( Model, Cmd Msg ) -stepOperationsOnDrop ( mo, cmds ) = - ( OperationsOnDrop mo, Cmd.map OperationsOnDropMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - case model of - OperationsOnDrag mo -> - Sub.map OperationsOnDragMsg (ConfigGroups.OperationsOnDrag.Root.subscriptions mo) - - OperationsOnDrop mo -> - Sub.map OperationsOnDropMsg (ConfigGroups.OperationsOnDrop.Root.subscriptions mo) - - - --- VIEW - - -navigationView : String -> Html.Html Msg -navigationView currentPath = - Html.div - [ Html.Attributes.class "navigation" ] - [ Html.h4 [] [ Html.text "DnDList.Groups" ] - , [ OperationsOnDrag ConfigGroups.OperationsOnDrag.Root.initialModel - , OperationsOnDrop ConfigGroups.OperationsOnDrop.Root.initialModel - ] - |> List.map (linkView currentPath) - |> Html.ul [] - ] - - -linkView : String -> Example -> Html.Html Msg -linkView currentPath example = - let - path : String - path = - Url.Builder.absolute [ Path.rootPath, "config-groups", (info >> .slug) example ] [] - in - Html.li [] - [ Html.a - [ Html.Attributes.classList [ ( "is-active", path == currentPath ) ] - , Html.Attributes.href path - ] - [ Html.text ((info >> .title) example) ] - ] - - -headerView : Model -> Html.Html Msg -headerView model = - let - title : String - title = - (info >> .title) model - - description : String - description = - (info >> .description) model - in - Html.header [] - [ Html.h2 [] [ Html.text title ] - , Html.p [] [ Html.text description ] - ] - - -demoView : Model -> Html.Html Msg -demoView model = - case model of - OperationsOnDrag mo -> - Html.map OperationsOnDragMsg (ConfigGroups.OperationsOnDrag.Root.view mo) - - OperationsOnDrop mo -> - Html.map OperationsOnDropMsg (ConfigGroups.OperationsOnDrop.Root.view mo) - - -codeView : Model -> Html.Html Msg -codeView model = - case model of - OperationsOnDrag mo -> - toCode (ConfigGroups.OperationsOnDrag.Root.url mo.id) - - OperationsOnDrop mo -> - toCode (ConfigGroups.OperationsOnDrop.Root.url mo.id) - - -toCode : String -> Html.Html msg -toCode url = - CustomElement.elmCode [ CustomElement.href url ] [] - - - --- EXAMPLE INFO - - -toExample : String -> Example -toExample slug = - case slug of - "operations-drag" -> - OperationsOnDrag ConfigGroups.OperationsOnDrag.Root.initialModel - - "operations-drop" -> - OperationsOnDrop ConfigGroups.OperationsOnDrop.Root.initialModel - - _ -> - OperationsOnDrag ConfigGroups.OperationsOnDrag.Root.initialModel - - -type alias Info = - { slug : String - , title : String - , description : String - } - - -info : Example -> Info -info example = - case example of - OperationsOnDrag _ -> - { slug = "operations-drag" - , title = "Operations on drag" - , description = "Compare the list operations with groups sorting on drag." - } - - OperationsOnDrop _ -> - { slug = "operations-drop" - , title = "Operations on drop" - , description = "Compare the list operations with groups sorting on drop." - } diff --git a/examples/src/CustomElement.elm b/examples/src/CustomElement.elm index deb5a91..03ccd5b 100755 --- a/examples/src/CustomElement.elm +++ b/examples/src/CustomElement.elm @@ -3,11 +3,17 @@ module CustomElement exposing (elmCode, href) import Html import Html.Attributes import Json.Encode +import WeakCss + + +moduleClass : WeakCss.ClassName +moduleClass = + WeakCss.namespace "dnd" elmCode : List (Html.Attribute msg) -> List (Html.Html msg) -> Html.Html msg elmCode attrs elems = - Html.node "elm-code" attrs elems + Html.node "elm-code" ([ moduleClass |> WeakCss.nestMany [ "main", "code" ] ] ++ attrs) elems href : String -> Html.Attribute msg diff --git a/examples/src/Demo.elm b/examples/src/Demo.elm new file mode 100755 index 0000000..cf7f566 --- /dev/null +++ b/examples/src/Demo.elm @@ -0,0 +1,166 @@ +module Demo exposing (..) + +import Browser +import Browser.Navigation +import DnDList.Groups.Parent +import DnDList.Single.Parent +import Gallery.Parent +import Html +import Html.Attributes +import Introduction.Parent +import Url +import Views +import WeakCss + + + +-- MODEL + + +type Example + = Introduction Introduction.Parent.Example + | Single DnDList.Single.Parent.Example + | Groups DnDList.Groups.Parent.Example + | Gallery Gallery.Parent.Example + + +init : String -> String -> ( Example, Cmd Msg ) +init slug inner = + toExample slug inner + + + +-- UPDATE + + +type Msg + = IntroductionMsg Introduction.Parent.Msg + | SingleMsg DnDList.Single.Parent.Msg + | GroupsMsg DnDList.Groups.Parent.Msg + | GalleryMsg Gallery.Parent.Msg + + +subscriptions : Example -> Sub Msg +subscriptions model = + case model of + Introduction mo -> + Sub.map IntroductionMsg (Introduction.Parent.subscriptions mo) + + Single mo -> + Sub.map SingleMsg (DnDList.Single.Parent.subscriptions mo) + + Groups mo -> + Sub.map GroupsMsg (DnDList.Groups.Parent.subscriptions mo) + + Gallery mo -> + Sub.map GalleryMsg (Gallery.Parent.subscriptions mo) + + +update : Browser.Navigation.Key -> Msg -> Example -> ( Example, Cmd Msg ) +update key msg model = + case ( msg, model ) of + ( IntroductionMsg subMsg, Introduction subModel ) -> + stepIntroduction (Introduction.Parent.update subMsg subModel) + + ( SingleMsg subMsg, Single subModel ) -> + stepSingle (DnDList.Single.Parent.update subMsg subModel) + + ( GroupsMsg subMsg, Groups subModel ) -> + stepGroups (DnDList.Groups.Parent.update subMsg subModel) + + ( GalleryMsg subMsg, Gallery subModel ) -> + stepGallery (Gallery.Parent.update subMsg subModel) + + _ -> + ( model, Cmd.none ) + + +stepIntroduction : ( Introduction.Parent.Example, Cmd Introduction.Parent.Msg ) -> ( Example, Cmd Msg ) +stepIntroduction ( subModel, subCmd ) = + ( Introduction subModel, Cmd.map IntroductionMsg subCmd ) + + +stepSingle : ( DnDList.Single.Parent.Example, Cmd DnDList.Single.Parent.Msg ) -> ( Example, Cmd Msg ) +stepSingle ( subModel, subCmd ) = + ( Single subModel, Cmd.map SingleMsg subCmd ) + + +stepGroups : ( DnDList.Groups.Parent.Example, Cmd DnDList.Groups.Parent.Msg ) -> ( Example, Cmd Msg ) +stepGroups ( subModel, subCmd ) = + ( Groups subModel, Cmd.map GroupsMsg subCmd ) + + +stepGallery : ( Gallery.Parent.Example, Cmd Gallery.Parent.Msg ) -> ( Example, Cmd Msg ) +stepGallery ( subModel, subCmd ) = + ( Gallery subModel, Cmd.map GalleryMsg subCmd ) + + + +-- VIEW + + +moduleClass : WeakCss.ClassName +moduleClass = + WeakCss.namespace "dnd" + + +view : Bool -> Example -> Html.Html Msg +view showSidebar model = + Html.main_ + [ moduleClass |> WeakCss.nest "demo" ] + [ Html.section + [ moduleClass |> WeakCss.nestMany [ "demo", "content" ] ] + (case model of + Introduction mo -> + List.map (Html.map IntroductionMsg) (Introduction.Parent.view mo) + + Single mo -> + List.map (Html.map SingleMsg) (DnDList.Single.Parent.view mo) + + Groups mo -> + List.map (Html.map GroupsMsg) (DnDList.Groups.Parent.view mo) + + Gallery mo -> + List.map (Html.map GalleryMsg) (Gallery.Parent.view mo) + ) + , Html.section + [ moduleClass |> WeakCss.addMany [ "demo", "chapters" ] |> WeakCss.withStates [ ( "show", showSidebar ) ] ] + [ Introduction.Parent.chapterView "demo" + , Gallery.Parent.chapterView "demo" + , DnDList.Single.Parent.chapterView "demo" + , DnDList.Groups.Parent.chapterView "demo" + ] + ] + + + +-- EXAMPLE INFO + + +toExample : String -> String -> ( Example, Cmd Msg ) +toExample slug inner = + case slug of + "introduction" -> + Introduction.Parent.init inner + |> Tuple.mapFirst Introduction + |> Tuple.mapSecond (Cmd.map IntroductionMsg) + + "single" -> + DnDList.Single.Parent.init inner + |> Tuple.mapFirst Single + |> Tuple.mapSecond (Cmd.map SingleMsg) + + "groups" -> + DnDList.Groups.Parent.init inner + |> Tuple.mapFirst Groups + |> Tuple.mapSecond (Cmd.map GroupsMsg) + + "gallery" -> + Gallery.Parent.init inner + |> Tuple.mapFirst Gallery + |> Tuple.mapSecond (Cmd.map GalleryMsg) + + _ -> + Introduction.Parent.init inner + |> Tuple.mapFirst Introduction + |> Tuple.mapSecond (Cmd.map IntroductionMsg) diff --git a/examples/src/DnDList/Groups/HookCommands/DetectDrop.elm b/examples/src/DnDList/Groups/HookCommands/DetectDrop.elm new file mode 100644 index 0000000..cd45d20 --- /dev/null +++ b/examples/src/DnDList/Groups/HookCommands/DetectDrop.elm @@ -0,0 +1,320 @@ +module DnDList.Groups.HookCommands.DetectDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) + +import Browser +import DnDList +import DnDList.Groups +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + { group : Int + , value : String + , color : String + } + + +preparedData : List Item +preparedData = + [ Item 1 "F" letterColor + , Item 1 "3" numberColor + , Item 1 "1" numberColor + , Item 1 "L" letterColor + , Item 1 "A" letterColor + , Item 1 "" transparent + , Item 2 "4" numberColor + , Item 2 "S" letterColor + , Item 2 "8" numberColor + , Item 2 "M" letterColor + , Item 2 "" transparent + ] + + + +-- DND + + +system : DnDList.Groups.System Item Msg +system = + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrop + |> DnDList.Groups.operation DnDList.InsertBefore + |> DnDList.Groups.groups + { listen = DnDList.OnDrop + , operation = DnDList.InsertBefore + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.detectDrop DetectDrop + |> DnDList.Groups.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , history : List ( Int, Int ) + , dnd : DnDList.Groups.Model + } + + +initialModel : Model +initialModel = + { items = preparedData + , history = [] + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Groups.Msg + | DetectDrop Int Int (List Item) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + DetectDrop dragIndex dropIndex _ -> + ( { model | history = ( dragIndex, dropIndex ) :: model.history } + , Cmd.none + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section [] + [ Html.div [ Html.Attributes.style "display" "flex" ] + [ historyView model.history + , groupView model 1 + , groupView model 2 + ] + , ghostView model.dnd model.items + ] + + +historyView : List ( Int, Int ) -> Html.Html Msg +historyView history = + let + eventView ( i, j ) = + Html.li [] [ Html.text (String.fromInt i ++ " ⟷ " ++ String.fromInt j) ] + in + history + |> List.map eventView + |> (::) (Html.li [] [ Html.text "i ⟷ j" ]) + |> Html.ul [ Html.Attributes.style "list-style" "none", Html.Attributes.style "width" "100px", Html.Attributes.style "font-family" "monospace" ] + + +groupView : Model -> Int -> Html.Html Msg +groupView model currentGroup = + model.items + |> List.filter (\{ group } -> group == currentGroup) + |> List.indexedMap (itemView model (calculateOffset 0 currentGroup model.items)) + |> Html.div groupStyles + + +itemView : Model -> Int -> Int -> Item -> Html.Html Msg +itemView model offset localIndex { group, value, color } = + let + globalIndex : Int + globalIndex = + offset + localIndex + + itemId : String + itemId = + "detectdrop-" ++ String.fromInt globalIndex + in + case ( system.info model.dnd, maybeDragItem model.dnd model.items ) of + ( Just { dragIndex, dropIndex }, Just dragItem ) -> + if value == "" then + Html.div + (Html.Attributes.id itemId :: auxiliaryItemStyles ++ system.dropEvents globalIndex itemId) + [] + + else if globalIndex /= dragIndex && globalIndex /= dropIndex then + Html.div + (Html.Attributes.id itemId :: itemStyles color ++ system.dropEvents globalIndex itemId) + [ Html.text value ] + + else if globalIndex /= dragIndex && globalIndex == dropIndex then + Html.div + (Html.Attributes.id itemId :: itemStyles dropColor ++ system.dropEvents globalIndex itemId) + [ Html.text value ] + + else + Html.div + (Html.Attributes.id itemId :: itemStyles dropColor) + [] + + _ -> + if value == "" then + Html.div + (Html.Attributes.id itemId :: auxiliaryItemStyles) + [] + + else + Html.div + (Html.Attributes.id itemId :: itemStyles color ++ system.dragEvents globalIndex itemId) + [ Html.text value ] + + +ghostView : DnDList.Groups.Model -> List Item -> Html.Html Msg +ghostView dnd items = + case maybeDragItem dnd items of + Just item -> + Html.div + (itemStyles item.color ++ system.ghostStyles dnd) + [ Html.text item.value ] + + Nothing -> + Html.text "" + + + +-- HELPERS + + +calculateOffset : Int -> Int -> List Item -> Int +calculateOffset index group list = + case list of + [] -> + 0 + + x :: xs -> + if x.group == group then + index + + else + calculateOffset (index + 1) group xs + + +maybeDragItem : DnDList.Groups.Model -> List Item -> Maybe Item +maybeDragItem dnd items = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + + + +-- COLORS + + +dropColor : String +dropColor = + "gray" + + +numberColor : String +numberColor = + "#fb5f51" + + +letterColor : String +letterColor = + "#5b84b1" + + +transparent : String +transparent = + "transparent" + + + +-- STYLES + + +containerStyles : List (Html.Attribute msg) +containerStyles = + [ Html.Attributes.style "display" "flex" ] + + +groupStyles : List (Html.Attribute msg) +groupStyles = + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "flex-direction" "column" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "padding-bottom" "4rem" + ] + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "background-color" color + , Html.Attributes.style "border-radius" "8px" + , Html.Attributes.style "color" "black" + , Html.Attributes.style "cursor" "pointer" + , Html.Attributes.style "font-size" "1.2em" + , Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "center" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "margin" "0 1.5em 1.5em 0" + , Html.Attributes.style "width" "50px" + , Html.Attributes.style "height" "50px" + ] + + +placeholderStyles : List (Html.Attribute msg) +placeholderStyles = + [ Html.Attributes.style "background-color" "dimgray" ] + + +auxiliaryItemStyles : List (Html.Attribute msg) +auxiliaryItemStyles = + [ Html.Attributes.style "flex-grow" "1" + , Html.Attributes.style "box-sizing" "border-box" + , Html.Attributes.style "margin-right" "1.5rem" + , Html.Attributes.style "width" "auto" + , Html.Attributes.style "height" "50px" + , Html.Attributes.style "min-width" "50px" + , Html.Attributes.style "border" "3px dashed gray" + , Html.Attributes.style "background-color" "transparent" + ] diff --git a/examples/src/DnDList/Groups/HookCommands/DetectReorder.elm b/examples/src/DnDList/Groups/HookCommands/DetectReorder.elm new file mode 100755 index 0000000..ee19d1d --- /dev/null +++ b/examples/src/DnDList/Groups/HookCommands/DetectReorder.elm @@ -0,0 +1,320 @@ +module DnDList.Groups.HookCommands.DetectReorder exposing (Model, Msg, initialModel, main, subscriptions, update, view) + +import Browser +import DnDList +import DnDList.Groups +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + { group : Int + , value : String + , color : String + } + + +preparedData : List Item +preparedData = + [ Item 1 "F" letterColor + , Item 1 "3" numberColor + , Item 1 "1" numberColor + , Item 1 "L" letterColor + , Item 1 "A" letterColor + , Item 1 "" transparent + , Item 2 "4" numberColor + , Item 2 "S" letterColor + , Item 2 "8" numberColor + , Item 2 "M" letterColor + , Item 2 "" transparent + ] + + + +-- DND + + +system : DnDList.Groups.System Item Msg +system = + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.InsertBefore + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.InsertBefore + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.detectReorder DetectReorder + |> DnDList.Groups.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , history : List ( Int, Int ) + , dnd : DnDList.Groups.Model + } + + +initialModel : Model +initialModel = + { items = preparedData + , history = [] + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Groups.Msg + | DetectReorder Int Int (List Item) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + DetectReorder dragIndex dropIndex _ -> + ( { model | history = ( dragIndex, dropIndex ) :: model.history } + , Cmd.none + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section [] + [ Html.div [ Html.Attributes.style "display" "flex" ] + [ historyView model.history + , groupView model 1 + , groupView model 2 + ] + , ghostView model.dnd model.items + ] + + +historyView : List ( Int, Int ) -> Html.Html Msg +historyView history = + let + eventView ( i, j ) = + Html.li [] [ Html.text (String.fromInt i ++ " ⟷ " ++ String.fromInt j) ] + in + history + |> List.map eventView + |> (::) (Html.li [] [ Html.text "i ⟷ j" ]) + |> Html.ul [ Html.Attributes.style "list-style" "none", Html.Attributes.style "width" "100px", Html.Attributes.style "font-family" "monospace" ] + + +groupView : Model -> Int -> Html.Html Msg +groupView model currentGroup = + model.items + |> List.filter (\{ group } -> group == currentGroup) + |> List.indexedMap (itemView model (calculateOffset 0 currentGroup model.items)) + |> Html.div groupStyles + + +itemView : Model -> Int -> Int -> Item -> Html.Html Msg +itemView model offset localIndex { group, value, color } = + let + globalIndex : Int + globalIndex = + offset + localIndex + + itemId : String + itemId = + "detectreorder-" ++ String.fromInt globalIndex + in + case ( system.info model.dnd, maybeDragItem model.dnd model.items ) of + ( Just { dragIndex, dropIndex }, Just dragItem ) -> + if value == "" then + Html.div + (Html.Attributes.id itemId :: auxiliaryItemStyles ++ system.dropEvents globalIndex itemId) + [] + + else if globalIndex /= dragIndex && globalIndex /= dropIndex then + Html.div + (Html.Attributes.id itemId :: itemStyles color ++ system.dropEvents globalIndex itemId) + [ Html.text value ] + + else if globalIndex /= dragIndex && globalIndex == dropIndex then + Html.div + (Html.Attributes.id itemId :: itemStyles dropColor ++ system.dropEvents globalIndex itemId) + [ Html.text value ] + + else + Html.div + (Html.Attributes.id itemId :: itemStyles dropColor) + [] + + _ -> + if value == "" then + Html.div + (Html.Attributes.id itemId :: auxiliaryItemStyles) + [] + + else + Html.div + (Html.Attributes.id itemId :: itemStyles color ++ system.dragEvents globalIndex itemId) + [ Html.text value ] + + +ghostView : DnDList.Groups.Model -> List Item -> Html.Html Msg +ghostView dnd items = + case maybeDragItem dnd items of + Just item -> + Html.div + (itemStyles item.color ++ system.ghostStyles dnd) + [ Html.text item.value ] + + Nothing -> + Html.text "" + + + +-- HELPERS + + +calculateOffset : Int -> Int -> List Item -> Int +calculateOffset index group list = + case list of + [] -> + 0 + + x :: xs -> + if x.group == group then + index + + else + calculateOffset (index + 1) group xs + + +maybeDragItem : DnDList.Groups.Model -> List Item -> Maybe Item +maybeDragItem dnd items = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + + + +-- COLORS + + +dropColor : String +dropColor = + "gray" + + +numberColor : String +numberColor = + "#fb5f51" + + +letterColor : String +letterColor = + "#5b84b1" + + +transparent : String +transparent = + "transparent" + + + +-- STYLES + + +containerStyles : List (Html.Attribute msg) +containerStyles = + [ Html.Attributes.style "display" "flex" ] + + +groupStyles : List (Html.Attribute msg) +groupStyles = + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "flex-direction" "column" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "padding-bottom" "4rem" + ] + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "background-color" color + , Html.Attributes.style "border-radius" "8px" + , Html.Attributes.style "color" "black" + , Html.Attributes.style "cursor" "pointer" + , Html.Attributes.style "font-size" "1.2em" + , Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "center" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "margin" "0 1.5em 1.5em 0" + , Html.Attributes.style "width" "50px" + , Html.Attributes.style "height" "50px" + ] + + +placeholderStyles : List (Html.Attribute msg) +placeholderStyles = + [ Html.Attributes.style "background-color" "dimgray" ] + + +auxiliaryItemStyles : List (Html.Attribute msg) +auxiliaryItemStyles = + [ Html.Attributes.style "flex-grow" "1" + , Html.Attributes.style "box-sizing" "border-box" + , Html.Attributes.style "margin-right" "1.5rem" + , Html.Attributes.style "width" "auto" + , Html.Attributes.style "height" "50px" + , Html.Attributes.style "min-width" "50px" + , Html.Attributes.style "border" "3px dashed gray" + , Html.Attributes.style "background-color" "transparent" + ] diff --git a/examples/src/DnDList/Groups/HookCommands/Parent.elm b/examples/src/DnDList/Groups/HookCommands/Parent.elm new file mode 100755 index 0000000..1e96b24 --- /dev/null +++ b/examples/src/DnDList/Groups/HookCommands/Parent.elm @@ -0,0 +1,147 @@ +module DnDList.Groups.HookCommands.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Groups.HookCommands.DetectDrop +import DnDList.Groups.HookCommands.DetectReorder +import Html +import Views +import WeakCss + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = DetectDrop DnDList.Groups.HookCommands.DetectDrop.Model + | DetectReorder DnDList.Groups.HookCommands.DetectReorder.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ DetectDrop DnDList.Groups.HookCommands.DetectDrop.initialModel + , DetectReorder DnDList.Groups.HookCommands.DetectReorder.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/HookCommands/DetectDrop.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/HookCommands/DetectReorder.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | DetectDropMsg DnDList.Groups.HookCommands.DetectDrop.Msg + | DetectReorderMsg DnDList.Groups.HookCommands.DetectReorder.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( DetectDropMsg msg, DetectDrop mo ) -> + stepDetectDrop (DnDList.Groups.HookCommands.DetectDrop.update msg mo) + + ( DetectReorderMsg msg, DetectReorder mo ) -> + stepDetectReorder (DnDList.Groups.HookCommands.DetectReorder.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepDetectDrop : ( DnDList.Groups.HookCommands.DetectDrop.Model, Cmd DnDList.Groups.HookCommands.DetectDrop.Msg ) -> ( Example, Cmd Msg ) +stepDetectDrop ( mo, cmds ) = + ( DetectDrop mo, Cmd.map DetectDropMsg cmds ) + + +stepDetectReorder : ( DnDList.Groups.HookCommands.DetectReorder.Model, Cmd DnDList.Groups.HookCommands.DetectReorder.Msg ) -> ( Example, Cmd Msg ) +stepDetectReorder ( mo, cmds ) = + ( DetectReorder mo, Cmd.map DetectReorderMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + DetectDrop mo -> + Sub.map DetectDropMsg (DnDList.Groups.HookCommands.DetectDrop.subscriptions mo) + + DetectReorder mo -> + Sub.map DetectReorderMsg (DnDList.Groups.HookCommands.DetectReorder.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + DetectDrop mo -> + { title = "Detect drop with insert before" + , subView = Html.map DetectDropMsg (DnDList.Groups.HookCommands.DetectDrop.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/HookCommands/DetectDrop.elm" + } + + DetectReorder mo -> + { title = "Detect reorder with insert before" + , subView = Html.map DetectReorderMsg (DnDList.Groups.HookCommands.DetectReorder.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/HookCommands/DetectReorder.elm" + } diff --git a/examples/src/ConfigGroups/OperationsOnDrag/InsertAfter.elm b/examples/src/DnDList/Groups/OperationsOnDrag/InsertAfter.elm similarity index 86% rename from examples/src/ConfigGroups/OperationsOnDrag/InsertAfter.elm rename to examples/src/DnDList/Groups/OperationsOnDrag/InsertAfter.elm index e132814..45d3207 100755 --- a/examples/src/ConfigGroups/OperationsOnDrag/InsertAfter.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrag/InsertAfter.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrag.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrag.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -50,36 +51,22 @@ preparedData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.InsertAfter - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.InsertAfter + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -127,20 +114,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = preparedData + { items = preparedData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -158,20 +145,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/ConfigGroups/OperationsOnDrag/InsertBefore.elm b/examples/src/DnDList/Groups/OperationsOnDrag/InsertBefore.elm similarity index 86% rename from examples/src/ConfigGroups/OperationsOnDrag/InsertBefore.elm rename to examples/src/DnDList/Groups/OperationsOnDrag/InsertBefore.elm index 22693c4..4b622b3 100755 --- a/examples/src/ConfigGroups/OperationsOnDrag/InsertBefore.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrag/InsertBefore.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrag.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrag.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -50,36 +51,22 @@ preparedData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.InsertBefore - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.InsertBefore + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -127,20 +114,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = preparedData + { items = preparedData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -158,20 +145,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/DnDList/Groups/OperationsOnDrag/Parent.elm b/examples/src/DnDList/Groups/OperationsOnDrag/Parent.elm new file mode 100755 index 0000000..da8b3c0 --- /dev/null +++ b/examples/src/DnDList/Groups/OperationsOnDrag/Parent.elm @@ -0,0 +1,194 @@ +module DnDList.Groups.OperationsOnDrag.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Groups.OperationsOnDrag.InsertAfter +import DnDList.Groups.OperationsOnDrag.InsertBefore +import DnDList.Groups.OperationsOnDrag.Rotate +import DnDList.Groups.OperationsOnDrag.Swap +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = InsertAfter DnDList.Groups.OperationsOnDrag.InsertAfter.Model + | InsertBefore DnDList.Groups.OperationsOnDrag.InsertBefore.Model + | Rotate DnDList.Groups.OperationsOnDrag.Rotate.Model + | Swap DnDList.Groups.OperationsOnDrag.Swap.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ InsertAfter DnDList.Groups.OperationsOnDrag.InsertAfter.initialModel + , InsertBefore DnDList.Groups.OperationsOnDrag.InsertBefore.initialModel + , Rotate DnDList.Groups.OperationsOnDrag.Rotate.initialModel + , Swap DnDList.Groups.OperationsOnDrag.Swap.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/DetectReorder.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/InsertBefore.elm" + + 2 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/Rotate.elm" + + 3 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/DetectReorder.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | InsertAfterMsg DnDList.Groups.OperationsOnDrag.InsertAfter.Msg + | InsertBeforeMsg DnDList.Groups.OperationsOnDrag.InsertBefore.Msg + | RotateMsg DnDList.Groups.OperationsOnDrag.Rotate.Msg + | SwapMsg DnDList.Groups.OperationsOnDrag.Swap.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( InsertAfterMsg msg, InsertAfter mo ) -> + stepInsertAfter (DnDList.Groups.OperationsOnDrag.InsertAfter.update msg mo) + + ( InsertBeforeMsg msg, InsertBefore mo ) -> + stepInsertBefore (DnDList.Groups.OperationsOnDrag.InsertBefore.update msg mo) + + ( RotateMsg msg, Rotate mo ) -> + stepRotate (DnDList.Groups.OperationsOnDrag.Rotate.update msg mo) + + ( SwapMsg msg, Swap mo ) -> + stepSwap (DnDList.Groups.OperationsOnDrag.Swap.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepInsertAfter : ( DnDList.Groups.OperationsOnDrag.InsertAfter.Model, Cmd DnDList.Groups.OperationsOnDrag.InsertAfter.Msg ) -> ( Example, Cmd Msg ) +stepInsertAfter ( mo, cmds ) = + ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) + + +stepInsertBefore : ( DnDList.Groups.OperationsOnDrag.InsertBefore.Model, Cmd DnDList.Groups.OperationsOnDrag.InsertBefore.Msg ) -> ( Example, Cmd Msg ) +stepInsertBefore ( mo, cmds ) = + ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) + + +stepRotate : ( DnDList.Groups.OperationsOnDrag.Rotate.Model, Cmd DnDList.Groups.OperationsOnDrag.Rotate.Msg ) -> ( Example, Cmd Msg ) +stepRotate ( mo, cmds ) = + ( Rotate mo, Cmd.map RotateMsg cmds ) + + +stepSwap : ( DnDList.Groups.OperationsOnDrag.Swap.Model, Cmd DnDList.Groups.OperationsOnDrag.Swap.Msg ) -> ( Example, Cmd Msg ) +stepSwap ( mo, cmds ) = + ( Swap mo, Cmd.map SwapMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + InsertAfter mo -> + Sub.map InsertAfterMsg (DnDList.Groups.OperationsOnDrag.InsertAfter.subscriptions mo) + + InsertBefore mo -> + Sub.map InsertBeforeMsg (DnDList.Groups.OperationsOnDrag.InsertBefore.subscriptions mo) + + Rotate mo -> + Sub.map RotateMsg (DnDList.Groups.OperationsOnDrag.Rotate.subscriptions mo) + + Swap mo -> + Sub.map SwapMsg (DnDList.Groups.OperationsOnDrag.Swap.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + InsertAfter mo -> + { title = "Insert after" + , subView = Html.map InsertAfterMsg (DnDList.Groups.OperationsOnDrag.InsertAfter.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/DetectReorder.elm" + } + + InsertBefore mo -> + { title = "Insert before" + , subView = Html.map InsertBeforeMsg (DnDList.Groups.OperationsOnDrag.InsertBefore.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/InsertBefore.elm" + } + + Rotate mo -> + { title = "Rotate" + , subView = Html.map RotateMsg (DnDList.Groups.OperationsOnDrag.Rotate.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/Rotate.elm" + } + + Swap mo -> + { title = "Swap" + , subView = Html.map SwapMsg (DnDList.Groups.OperationsOnDrag.Swap.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrag/DetectReorder.elm" + } diff --git a/examples/src/ConfigGroups/OperationsOnDrag/Rotate.elm b/examples/src/DnDList/Groups/OperationsOnDrag/Rotate.elm similarity index 84% rename from examples/src/ConfigGroups/OperationsOnDrag/Rotate.elm rename to examples/src/DnDList/Groups/OperationsOnDrag/Rotate.elm index 7c76634..837bacf 100755 --- a/examples/src/ConfigGroups/OperationsOnDrag/Rotate.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrag/Rotate.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrag.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrag.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -47,36 +48,22 @@ gatheredData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Rotate - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.Rotate + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -124,20 +111,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = gatheredData + { items = gatheredData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -155,20 +142,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/ConfigGroups/OperationsOnDrag/Swap.elm b/examples/src/DnDList/Groups/OperationsOnDrag/Swap.elm similarity index 82% rename from examples/src/ConfigGroups/OperationsOnDrag/Swap.elm rename to examples/src/DnDList/Groups/OperationsOnDrag/Swap.elm index d46a8c2..e518f73 100755 --- a/examples/src/ConfigGroups/OperationsOnDrag/Swap.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrag/Swap.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrag.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrag.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -47,36 +48,22 @@ gatheredData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Swap - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.Swap + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -104,20 +91,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = gatheredData + { items = gatheredData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -135,20 +122,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/ConfigGroups/OperationsOnDrop/InsertAfter.elm b/examples/src/DnDList/Groups/OperationsOnDrop/InsertAfter.elm similarity index 86% rename from examples/src/ConfigGroups/OperationsOnDrop/InsertAfter.elm rename to examples/src/DnDList/Groups/OperationsOnDrop/InsertAfter.elm index 7021d68..cd03ee7 100755 --- a/examples/src/ConfigGroups/OperationsOnDrop/InsertAfter.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrop/InsertAfter.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrop.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrop.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -50,36 +51,22 @@ preparedData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.InsertAfter - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrop + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrop + , operation = DnDList.InsertAfter + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -127,20 +114,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = preparedData + { items = preparedData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -158,20 +145,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/ConfigGroups/OperationsOnDrop/InsertBefore.elm b/examples/src/DnDList/Groups/OperationsOnDrop/InsertBefore.elm similarity index 86% rename from examples/src/ConfigGroups/OperationsOnDrop/InsertBefore.elm rename to examples/src/DnDList/Groups/OperationsOnDrop/InsertBefore.elm index 083b314..4dab54a 100755 --- a/examples/src/ConfigGroups/OperationsOnDrop/InsertBefore.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrop/InsertBefore.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrop.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrop.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -50,36 +51,22 @@ preparedData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.InsertBefore - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrop + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrop + , operation = DnDList.InsertBefore + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -127,20 +114,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = preparedData + { items = preparedData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -158,20 +145,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/DnDList/Groups/OperationsOnDrop/Parent.elm b/examples/src/DnDList/Groups/OperationsOnDrop/Parent.elm new file mode 100755 index 0000000..fd039a1 --- /dev/null +++ b/examples/src/DnDList/Groups/OperationsOnDrop/Parent.elm @@ -0,0 +1,194 @@ +module DnDList.Groups.OperationsOnDrop.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Groups.OperationsOnDrop.InsertAfter +import DnDList.Groups.OperationsOnDrop.InsertBefore +import DnDList.Groups.OperationsOnDrop.Rotate +import DnDList.Groups.OperationsOnDrop.Swap +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = InsertAfter DnDList.Groups.OperationsOnDrop.InsertAfter.Model + | InsertBefore DnDList.Groups.OperationsOnDrop.InsertBefore.Model + | Rotate DnDList.Groups.OperationsOnDrop.Rotate.Model + | Swap DnDList.Groups.OperationsOnDrop.Swap.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ InsertAfter DnDList.Groups.OperationsOnDrop.InsertAfter.initialModel + , InsertBefore DnDList.Groups.OperationsOnDrop.InsertBefore.initialModel + , Rotate DnDList.Groups.OperationsOnDrop.Rotate.initialModel + , Swap DnDList.Groups.OperationsOnDrop.Swap.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/DetectReorder.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/InsertBefore.elm" + + 2 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/Rotate.elm" + + 3 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/DetectReorder.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | InsertAfterMsg DnDList.Groups.OperationsOnDrop.InsertAfter.Msg + | InsertBeforeMsg DnDList.Groups.OperationsOnDrop.InsertBefore.Msg + | RotateMsg DnDList.Groups.OperationsOnDrop.Rotate.Msg + | SwapMsg DnDList.Groups.OperationsOnDrop.Swap.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( InsertAfterMsg msg, InsertAfter mo ) -> + stepInsertAfter (DnDList.Groups.OperationsOnDrop.InsertAfter.update msg mo) + + ( InsertBeforeMsg msg, InsertBefore mo ) -> + stepInsertBefore (DnDList.Groups.OperationsOnDrop.InsertBefore.update msg mo) + + ( RotateMsg msg, Rotate mo ) -> + stepRotate (DnDList.Groups.OperationsOnDrop.Rotate.update msg mo) + + ( SwapMsg msg, Swap mo ) -> + stepSwap (DnDList.Groups.OperationsOnDrop.Swap.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepInsertAfter : ( DnDList.Groups.OperationsOnDrop.InsertAfter.Model, Cmd DnDList.Groups.OperationsOnDrop.InsertAfter.Msg ) -> ( Example, Cmd Msg ) +stepInsertAfter ( mo, cmds ) = + ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) + + +stepInsertBefore : ( DnDList.Groups.OperationsOnDrop.InsertBefore.Model, Cmd DnDList.Groups.OperationsOnDrop.InsertBefore.Msg ) -> ( Example, Cmd Msg ) +stepInsertBefore ( mo, cmds ) = + ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) + + +stepRotate : ( DnDList.Groups.OperationsOnDrop.Rotate.Model, Cmd DnDList.Groups.OperationsOnDrop.Rotate.Msg ) -> ( Example, Cmd Msg ) +stepRotate ( mo, cmds ) = + ( Rotate mo, Cmd.map RotateMsg cmds ) + + +stepSwap : ( DnDList.Groups.OperationsOnDrop.Swap.Model, Cmd DnDList.Groups.OperationsOnDrop.Swap.Msg ) -> ( Example, Cmd Msg ) +stepSwap ( mo, cmds ) = + ( Swap mo, Cmd.map SwapMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + InsertAfter mo -> + Sub.map InsertAfterMsg (DnDList.Groups.OperationsOnDrop.InsertAfter.subscriptions mo) + + InsertBefore mo -> + Sub.map InsertBeforeMsg (DnDList.Groups.OperationsOnDrop.InsertBefore.subscriptions mo) + + Rotate mo -> + Sub.map RotateMsg (DnDList.Groups.OperationsOnDrop.Rotate.subscriptions mo) + + Swap mo -> + Sub.map SwapMsg (DnDList.Groups.OperationsOnDrop.Swap.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + InsertAfter mo -> + { title = "Insert after" + , subView = Html.map InsertAfterMsg (DnDList.Groups.OperationsOnDrop.InsertAfter.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/DetectReorder.elm" + } + + InsertBefore mo -> + { title = "Insert before" + , subView = Html.map InsertBeforeMsg (DnDList.Groups.OperationsOnDrop.InsertBefore.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/InsertBefore.elm" + } + + Rotate mo -> + { title = "Rotate" + , subView = Html.map RotateMsg (DnDList.Groups.OperationsOnDrop.Rotate.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/Rotate.elm" + } + + Swap mo -> + { title = "Swap" + , subView = Html.map SwapMsg (DnDList.Groups.OperationsOnDrop.Swap.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList.Groups/OperationsOnDrop/DetectReorder.elm" + } diff --git a/examples/src/ConfigGroups/OperationsOnDrop/Rotate.elm b/examples/src/DnDList/Groups/OperationsOnDrop/Rotate.elm similarity index 84% rename from examples/src/ConfigGroups/OperationsOnDrop/Rotate.elm rename to examples/src/DnDList/Groups/OperationsOnDrop/Rotate.elm index 0a0c5e2..01936a2 100755 --- a/examples/src/ConfigGroups/OperationsOnDrop/Rotate.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrop/Rotate.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrop.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrop.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -47,36 +48,22 @@ gatheredData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Rotate - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrop + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrop + , operation = DnDList.Rotate + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -124,20 +111,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = gatheredData + { items = gatheredData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -155,20 +142,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/ConfigGroups/OperationsOnDrop/Swap.elm b/examples/src/DnDList/Groups/OperationsOnDrop/Swap.elm similarity index 83% rename from examples/src/ConfigGroups/OperationsOnDrop/Swap.elm rename to examples/src/DnDList/Groups/OperationsOnDrop/Swap.elm index 44990ad..4dd3196 100755 --- a/examples/src/ConfigGroups/OperationsOnDrop/Swap.elm +++ b/examples/src/DnDList/Groups/OperationsOnDrop/Swap.elm @@ -1,6 +1,7 @@ -module ConfigGroups.OperationsOnDrop.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Groups.OperationsOnDrop.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -47,36 +48,22 @@ gatheredData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = beforeUpdate - , listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Unaltered - , groups = - { listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Swap - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrop + |> DnDList.Groups.operation DnDList.Unaltered + |> DnDList.Groups.groups + { listen = DnDList.OnDrop + , operation = DnDList.Swap + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder beforeUpdate + |> DnDList.Groups.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -104,20 +91,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = gatheredData + { items = gatheredData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -135,20 +122,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> diff --git a/examples/src/DnDList/Groups/Parent.elm b/examples/src/DnDList/Groups/Parent.elm new file mode 100755 index 0000000..8dbd0e1 --- /dev/null +++ b/examples/src/DnDList/Groups/Parent.elm @@ -0,0 +1,221 @@ +module DnDList.Groups.Parent exposing + ( Example + , Msg + , chapterView + , init + , subscriptions + , update + , view + ) + +import AssocList +import CustomElement +import Dict +import DnDList.Groups.HookCommands.Parent +import DnDList.Groups.OperationsOnDrag.Parent +import DnDList.Groups.OperationsOnDrop.Parent +import Html +import Views + + + +-- WORKAROUND ENUM TYPE + + +defaultMeta : Views.Metadata Example +defaultMeta = + { segment = "operations-drag" + , title = "Operations on drag" + , description = "Compare the list operations sorting on drag" + , link = "" + , initialModel = OperationsOnDrag DnDList.Groups.OperationsOnDrag.Parent.initialModel + } + + +meta : List (Views.Metadata Example) +meta = + [ defaultMeta + , { segment = "operations-drop" + , title = "Operations on drop" + , description = "Compare the list operations sorting on drop" + , link = "" + , initialModel = OperationsOnDrop DnDList.Groups.OperationsOnDrop.Parent.initialModel + } + , { segment = "hook-commands" + , title = "Hook commands" + , description = "Compare detectDrop and detectReorder hooks" + , link = "" + , initialModel = HookCommands DnDList.Groups.HookCommands.Parent.initialModel + } + ] + + +type Tag + = OperationsOnDragTag + | OperationsOnDropTag + | HookCommandsTag + + +allTags : List Tag +allTags = + let + ignored : Tag -> () + ignored tag = + case tag of + OperationsOnDragTag -> + () + + OperationsOnDropTag -> + () + + HookCommandsTag -> + () + in + [ OperationsOnDragTag + , OperationsOnDropTag + , HookCommandsTag + ] + + +exampleToTag : Example -> Tag +exampleToTag example = + case example of + OperationsOnDrag _ -> + OperationsOnDragTag + + OperationsOnDrop _ -> + OperationsOnDropTag + + HookCommands _ -> + HookCommandsTag + + +tagSegmentDict : AssocList.Dict Tag (Views.Metadata Example) +tagSegmentDict = + List.map2 Tuple.pair allTags meta |> AssocList.fromList + + +tagToMetadata : Tag -> Views.Metadata Example +tagToMetadata tag = + Maybe.withDefault defaultMeta <| + case tag of + OperationsOnDragTag -> + AssocList.get OperationsOnDragTag tagSegmentDict + + OperationsOnDropTag -> + AssocList.get OperationsOnDropTag tagSegmentDict + + HookCommandsTag -> + AssocList.get HookCommandsTag tagSegmentDict + + + +-- MODEL + + +type Example + = OperationsOnDrag DnDList.Groups.OperationsOnDrag.Parent.Model + | OperationsOnDrop DnDList.Groups.OperationsOnDrop.Parent.Model + | HookCommands DnDList.Groups.HookCommands.Parent.Model + + +init : String -> ( Example, Cmd Msg ) +init segment = + ( meta + |> List.map (\m -> ( m.segment, m.initialModel )) + |> Dict.fromList + |> Dict.get segment + |> Maybe.withDefault defaultMeta.initialModel + , Cmd.none + ) + + + +-- UPDATE + + +type Msg + = OperationsOnDragMsg DnDList.Groups.OperationsOnDrag.Parent.Msg + | OperationsOnDropMsg DnDList.Groups.OperationsOnDrop.Parent.Msg + | HookCommandsMsg DnDList.Groups.HookCommands.Parent.Msg + + +subscriptions : Example -> Sub Msg +subscriptions model = + case model of + OperationsOnDrag subModel -> + Sub.map OperationsOnDragMsg (DnDList.Groups.OperationsOnDrag.Parent.subscriptions subModel) + + OperationsOnDrop subModel -> + Sub.map OperationsOnDropMsg (DnDList.Groups.OperationsOnDrop.Parent.subscriptions subModel) + + HookCommands subModel -> + Sub.map HookCommandsMsg (DnDList.Groups.HookCommands.Parent.subscriptions subModel) + + +update : Msg -> Example -> ( Example, Cmd Msg ) +update msg model = + case ( msg, model ) of + ( OperationsOnDragMsg subMsg, OperationsOnDrag subModel ) -> + stepOperationsOnDrag (DnDList.Groups.OperationsOnDrag.Parent.update subMsg subModel) + + ( OperationsOnDropMsg subMsg, OperationsOnDrop subModel ) -> + stepOperationsOnDrop (DnDList.Groups.OperationsOnDrop.Parent.update subMsg subModel) + + ( HookCommandsMsg subMsg, HookCommands subModel ) -> + stepHookCommands (DnDList.Groups.HookCommands.Parent.update subMsg subModel) + + _ -> + ( model, Cmd.none ) + + +stepOperationsOnDrag : ( DnDList.Groups.OperationsOnDrag.Parent.Model, Cmd DnDList.Groups.OperationsOnDrag.Parent.Msg ) -> ( Example, Cmd Msg ) +stepOperationsOnDrag ( subModel, subCmd ) = + ( OperationsOnDrag subModel, Cmd.map OperationsOnDragMsg subCmd ) + + +stepOperationsOnDrop : ( DnDList.Groups.OperationsOnDrop.Parent.Model, Cmd DnDList.Groups.OperationsOnDrop.Parent.Msg ) -> ( Example, Cmd Msg ) +stepOperationsOnDrop ( subModel, subCmd ) = + ( OperationsOnDrop subModel, Cmd.map OperationsOnDropMsg subCmd ) + + +stepHookCommands : ( DnDList.Groups.HookCommands.Parent.Model, Cmd DnDList.Groups.HookCommands.Parent.Msg ) -> ( Example, Cmd Msg ) +stepHookCommands ( subModel, subCmd ) = + ( HookCommands subModel, Cmd.map HookCommandsMsg subCmd ) + + + +-- VIEW + + +view : Example -> List (Html.Html Msg) +view example = + [ Views.demoHeaderView + (example + |> exampleToTag + |> tagToMetadata + |> (\m -> { title = m.title, description = m.description, link = m.link }) + ) + , case example of + OperationsOnDrag subModel -> + Html.map OperationsOnDragMsg (DnDList.Groups.OperationsOnDrag.Parent.view subModel) + + OperationsOnDrop subModel -> + Html.map OperationsOnDropMsg (DnDList.Groups.OperationsOnDrop.Parent.view subModel) + + HookCommands subModel -> + Html.map HookCommandsMsg (DnDList.Groups.HookCommands.Parent.view subModel) + , CustomElement.elmCode + [ CustomElement.href (example |> exampleToTag |> tagToMetadata |> (\m -> m.link)) ] + [] + ] + + +chapterView : String -> Html.Html msg +chapterView class = + Views.chapterView + class + { title = "DnDList.Groups" + , slug = "groups" + , allTags = allTags |> List.map (tagToMetadata >> (\m -> { segment = m.segment, title = m.title })) + } diff --git a/examples/src/DnDList/Single/HookCommands/DetectDrop.elm b/examples/src/DnDList/Single/HookCommands/DetectDrop.elm new file mode 100644 index 0000000..6d352c3 --- /dev/null +++ b/examples/src/DnDList/Single/HookCommands/DetectDrop.elm @@ -0,0 +1,228 @@ +module DnDList.Single.HookCommands.DetectDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) + +import Browser +import DnDList +import DnDList.Single +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + String + + +data : List Item +data = + List.range 1 5 + |> List.map String.fromInt + + + +-- DND + + +system : DnDList.Single.System Item Msg +system = + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.detectDrop DetectDrop + |> DnDList.Single.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , history : List ( Int, Int ) + , dnd : DnDList.Single.Model + } + + +initialModel : Model +initialModel = + { items = data + , history = [] + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Single.Msg + | DetectDrop Int Int (List Item) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + DetectDrop dragIndex dropIndex _ -> + ( { model | history = ( dragIndex, dropIndex ) :: model.history } + , Cmd.none + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section + [ Html.Attributes.style "display" "flex" ] + [ historyView model.history + , model.items + |> List.indexedMap (itemView model.dnd) + |> Html.div containerStyles + , ghostView model.dnd model.items + ] + + +historyView : List ( Int, Int ) -> Html.Html Msg +historyView history = + let + eventView ( i, j ) = + Html.li [] [ Html.text (String.fromInt i ++ " ⟷ " ++ String.fromInt j) ] + in + history + |> List.map eventView + |> (::) (Html.li [] [ Html.text "i ⟷ j" ]) + |> Html.ul historyStyles + + +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg +itemView dnd index item = + let + itemId : String + itemId = + "detectdrop-" ++ item + + attrs : List (Html.Attribute msg) + attrs = + Html.Attributes.id itemId :: itemStyles + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.div + (attrs ++ system.dropEvents index itemId) + [ Html.text item ] + + else + Html.div + (attrs ++ placeholderStyles) + [] + + Nothing -> + Html.div + (attrs ++ system.dragEvents index itemId) + [ Html.text item ] + + +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg +ghostView dnd items = + let + maybeDragItem : Maybe Item + maybeDragItem = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + in + case maybeDragItem of + Just item -> + Html.div + (itemStyles ++ ghostStyles ++ system.ghostStyles dnd) + [ Html.text item ] + + Nothing -> + Html.text "" + + + +-- STYLES + + +containerStyles : List (Html.Attribute msg) +containerStyles = + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "flex-direction" "column" + ] + + +historyStyles : List (Html.Attribute msg) +historyStyles = + [ Html.Attributes.style "list-style" "none" + , Html.Attributes.style "width" "100px" + , Html.Attributes.style "font-family" "monospace" + ] + + +itemStyles : List (Html.Attribute msg) +itemStyles = + [ Html.Attributes.style "background-color" "#5b84b1" + , Html.Attributes.style "border-radius" "8px" + , Html.Attributes.style "color" "black" + , Html.Attributes.style "cursor" "pointer" + , Html.Attributes.style "font-size" "1.2em" + , Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "center" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "margin" "0 1.5em 1.5em 0" + , Html.Attributes.style "width" "50px" + , Html.Attributes.style "height" "50px" + ] + + +placeholderStyles : List (Html.Attribute msg) +placeholderStyles = + [ Html.Attributes.style "background-color" "dimgray" ] + + +ghostStyles : List (Html.Attribute msg) +ghostStyles = + [ Html.Attributes.style "background-color" "#5b84b1" ] diff --git a/examples/src/DnDList/Single/HookCommands/DetectReorder.elm b/examples/src/DnDList/Single/HookCommands/DetectReorder.elm new file mode 100755 index 0000000..cd5bb7d --- /dev/null +++ b/examples/src/DnDList/Single/HookCommands/DetectReorder.elm @@ -0,0 +1,228 @@ +module DnDList.Single.HookCommands.DetectReorder exposing (Model, Msg, initialModel, main, subscriptions, update, view) + +import Browser +import DnDList +import DnDList.Single +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + String + + +data : List Item +data = + List.range 1 5 + |> List.map String.fromInt + + + +-- DND + + +system : DnDList.Single.System Item Msg +system = + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.detectReorder DetectReorder + |> DnDList.Single.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , history : List ( Int, Int ) + , dnd : DnDList.Single.Model + } + + +initialModel : Model +initialModel = + { items = data + , history = [] + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Single.Msg + | DetectReorder Int Int (List Item) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + DetectReorder dragIndex dropIndex _ -> + ( { model | history = ( dragIndex, dropIndex ) :: model.history } + , Cmd.none + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section + [ Html.Attributes.style "display" "flex" ] + [ historyView model.history + , model.items + |> List.indexedMap (itemView model.dnd) + |> Html.div containerStyles + , ghostView model.dnd model.items + ] + + +historyView : List ( Int, Int ) -> Html.Html Msg +historyView history = + let + eventView ( i, j ) = + Html.li [] [ Html.text (String.fromInt i ++ " ⟷ " ++ String.fromInt j) ] + in + history + |> List.map eventView + |> (::) (Html.li [] [ Html.text "i ⟷ j" ]) + |> Html.ul historyStyles + + +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg +itemView dnd index item = + let + itemId : String + itemId = + "detectreorder-" ++ item + + attrs : List (Html.Attribute msg) + attrs = + Html.Attributes.id itemId :: itemStyles + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.div + (attrs ++ system.dropEvents index itemId) + [ Html.text item ] + + else + Html.div + (attrs ++ placeholderStyles) + [] + + Nothing -> + Html.div + (attrs ++ system.dragEvents index itemId) + [ Html.text item ] + + +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg +ghostView dnd items = + let + maybeDragItem : Maybe Item + maybeDragItem = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + in + case maybeDragItem of + Just item -> + Html.div + (itemStyles ++ ghostStyles ++ system.ghostStyles dnd) + [ Html.text item ] + + Nothing -> + Html.text "" + + + +-- STYLES + + +containerStyles : List (Html.Attribute msg) +containerStyles = + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "flex-direction" "column" + ] + + +historyStyles : List (Html.Attribute msg) +historyStyles = + [ Html.Attributes.style "list-style" "none" + , Html.Attributes.style "width" "100px" + , Html.Attributes.style "font-family" "monospace" + ] + + +itemStyles : List (Html.Attribute msg) +itemStyles = + [ Html.Attributes.style "background-color" "#fb5f51" + , Html.Attributes.style "border-radius" "8px" + , Html.Attributes.style "color" "black" + , Html.Attributes.style "cursor" "pointer" + , Html.Attributes.style "font-size" "1.2em" + , Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "center" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "margin" "0 1.5em 1.5em 0" + , Html.Attributes.style "width" "50px" + , Html.Attributes.style "height" "50px" + ] + + +placeholderStyles : List (Html.Attribute msg) +placeholderStyles = + [ Html.Attributes.style "background-color" "dimgray" ] + + +ghostStyles : List (Html.Attribute msg) +ghostStyles = + [ Html.Attributes.style "background-color" "#fb5f51" ] diff --git a/examples/src/DnDList/Single/HookCommands/Parent.elm b/examples/src/DnDList/Single/HookCommands/Parent.elm new file mode 100755 index 0000000..31c334c --- /dev/null +++ b/examples/src/DnDList/Single/HookCommands/Parent.elm @@ -0,0 +1,146 @@ +module DnDList.Single.HookCommands.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Single.HookCommands.DetectDrop +import DnDList.Single.HookCommands.DetectReorder +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = DetectDrop DnDList.Single.HookCommands.DetectDrop.Model + | DetectReorder DnDList.Single.HookCommands.DetectReorder.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ DetectDrop DnDList.Single.HookCommands.DetectDrop.initialModel + , DetectReorder DnDList.Single.HookCommands.DetectReorder.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/HookCommands/DetectDrop.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/HookCommands/DetectReorder.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | DetectDropMsg DnDList.Single.HookCommands.DetectDrop.Msg + | DetectReorderMsg DnDList.Single.HookCommands.DetectReorder.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( DetectDropMsg msg, DetectDrop mo ) -> + stepDetectDrop (DnDList.Single.HookCommands.DetectDrop.update msg mo) + + ( DetectReorderMsg msg, DetectReorder mo ) -> + stepDetectReorder (DnDList.Single.HookCommands.DetectReorder.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepDetectDrop : ( DnDList.Single.HookCommands.DetectDrop.Model, Cmd DnDList.Single.HookCommands.DetectDrop.Msg ) -> ( Example, Cmd Msg ) +stepDetectDrop ( mo, cmds ) = + ( DetectDrop mo, Cmd.map DetectDropMsg cmds ) + + +stepDetectReorder : ( DnDList.Single.HookCommands.DetectReorder.Model, Cmd DnDList.Single.HookCommands.DetectReorder.Msg ) -> ( Example, Cmd Msg ) +stepDetectReorder ( mo, cmds ) = + ( DetectReorder mo, Cmd.map DetectReorderMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + DetectDrop mo -> + Sub.map DetectDropMsg (DnDList.Single.HookCommands.DetectDrop.subscriptions mo) + + DetectReorder mo -> + Sub.map DetectReorderMsg (DnDList.Single.HookCommands.DetectReorder.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + DetectDrop mo -> + { title = "Detect drop with swap" + , subView = Html.map DetectDropMsg (DnDList.Single.HookCommands.DetectDrop.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/HookCommands/DetectDrop.elm" + } + + DetectReorder mo -> + { title = "Detect reorder with swap" + , subView = Html.map DetectReorderMsg (DnDList.Single.HookCommands.DetectReorder.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/HookCommands/DetectReorder.elm" + } diff --git a/examples/src/Config/Movement/FreeOnDrag.elm b/examples/src/DnDList/Single/Movement/FreeOnDrag.elm similarity index 79% rename from examples/src/Config/Movement/FreeOnDrag.elm rename to examples/src/DnDList/Single/Movement/FreeOnDrag.elm index afbcf38..c8d104f 100755 --- a/examples/src/Config/Movement/FreeOnDrag.elm +++ b/examples/src/DnDList/Single/Movement/FreeOnDrag.elm @@ -1,7 +1,8 @@ -module Config.Movement.FreeOnDrag exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.Movement.FreeOnDrag exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -36,21 +37,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.movement DnDList.Free + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -58,22 +54,22 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item , affected : List Int + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data , affected = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -91,21 +87,21 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ClearAffected update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd affected : List Int affected = - case system.info dnd of + case system.info dndModel of Just { dragIndex, dropIndex } -> if dragIndex /= dropIndex then dragIndex :: dropIndex :: model.affected @@ -116,8 +112,8 @@ update message model = _ -> model.affected in - ( { model | dnd = dnd, items = items, affected = affected } - , system.commands dnd + ( { model | items = items, affected = affected, dnd = dndModel } + , dndCmd ) ClearAffected -> @@ -139,7 +135,7 @@ view model = ] -itemView : DnDList.Model -> List Int -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> List Int -> Int -> Item -> Html.Html Msg itemView dnd affected index item = let itemId : String @@ -175,7 +171,7 @@ itemView dnd affected index item = [ Html.text item ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -209,7 +205,7 @@ containerStyles = itemStyles : List (Html.Attribute msg) itemStyles = - [ Html.Attributes.style "background-color" "#aa1e9d" + [ Html.Attributes.style "background-color" "#44526f" , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" diff --git a/examples/src/Config/Movement/FreeOnDrop.elm b/examples/src/DnDList/Single/Movement/FreeOnDrop.elm similarity index 80% rename from examples/src/Config/Movement/FreeOnDrop.elm rename to examples/src/DnDList/Single/Movement/FreeOnDrop.elm index 8f15e86..d1bf5c4 100755 --- a/examples/src/Config/Movement/FreeOnDrop.elm +++ b/examples/src/DnDList/Single/Movement/FreeOnDrop.elm @@ -1,7 +1,8 @@ -module Config.Movement.FreeOnDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.Movement.FreeOnDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -36,21 +37,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.movement DnDList.Free + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -58,22 +54,22 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item , affected : List Int + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data , affected = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -91,21 +87,21 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ClearAffected update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd affected : List Int affected = - case system.info dnd of + case system.info dndModel of Just { dragIndex, dropIndex } -> if dragIndex /= dropIndex then [ dragIndex, dropIndex ] @@ -116,8 +112,8 @@ update message model = _ -> model.affected in - ( { model | dnd = dnd, items = items, affected = affected } - , system.commands dnd + ( { model | items = items, affected = affected, dnd = dndModel } + , dndCmd ) ClearAffected -> @@ -139,7 +135,7 @@ view model = ] -itemView : DnDList.Model -> List Int -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> List Int -> Int -> Item -> Html.Html Msg itemView dnd affected index item = let itemId : String @@ -180,7 +176,7 @@ itemView dnd affected index item = [ Html.text item ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -214,7 +210,7 @@ containerStyles = itemStyles : List (Html.Attribute msg) itemStyles = - [ Html.Attributes.style "background-color" "#1e9daa" + [ Html.Attributes.style "background-color" "#eabd00" , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" diff --git a/examples/src/Config/Movement/HorizontalOnDrag.elm b/examples/src/DnDList/Single/Movement/HorizontalOnDrag.elm similarity index 79% rename from examples/src/Config/Movement/HorizontalOnDrag.elm rename to examples/src/DnDList/Single/Movement/HorizontalOnDrag.elm index 5146039..740eac5 100755 --- a/examples/src/Config/Movement/HorizontalOnDrag.elm +++ b/examples/src/DnDList/Single/Movement/HorizontalOnDrag.elm @@ -1,7 +1,8 @@ -module Config.Movement.HorizontalOnDrag exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.Movement.HorizontalOnDrag exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -36,21 +37,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Horizontal - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.movement DnDList.Horizontal + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -58,22 +54,22 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item , affected : List Int + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data , affected = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -91,21 +87,21 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ClearAffected update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd affected : List Int affected = - case system.info dnd of + case system.info dndModel of Just { dragIndex, dropIndex } -> if dragIndex /= dropIndex then dragIndex :: dropIndex :: model.affected @@ -116,8 +112,8 @@ update message model = _ -> model.affected in - ( { model | dnd = dnd, items = items, affected = affected } - , system.commands dnd + ( { model | items = items, affected = affected, dnd = dndModel } + , dndCmd ) ClearAffected -> @@ -139,7 +135,7 @@ view model = ] -itemView : DnDList.Model -> List Int -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> List Int -> Int -> Item -> Html.Html Msg itemView dnd affected index item = let itemId : String @@ -175,7 +171,7 @@ itemView dnd affected index item = [ Html.text item ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -204,7 +200,7 @@ containerStyles = itemStyles : List (Html.Attribute msg) itemStyles = - [ Html.Attributes.style "background-color" "#aa1e9d" + [ Html.Attributes.style "background-color" "#3692c7" , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" diff --git a/examples/src/Config/Movement/HorizontalOnDrop.elm b/examples/src/DnDList/Single/Movement/HorizontalOnDrop.elm similarity index 80% rename from examples/src/Config/Movement/HorizontalOnDrop.elm rename to examples/src/DnDList/Single/Movement/HorizontalOnDrop.elm index e4ac27f..a06318e 100755 --- a/examples/src/Config/Movement/HorizontalOnDrop.elm +++ b/examples/src/DnDList/Single/Movement/HorizontalOnDrop.elm @@ -1,7 +1,8 @@ -module Config.Movement.HorizontalOnDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.Movement.HorizontalOnDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -36,21 +37,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Horizontal - , listen = DnDList.OnDrop - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.movement DnDList.Horizontal + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -58,22 +54,22 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item , affected : List Int + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data , affected = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -91,21 +87,21 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ClearAffected update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd affected : List Int affected = - case system.info dnd of + case system.info dndModel of Just { dragIndex, dropIndex } -> if dragIndex /= dropIndex then [ dragIndex, dropIndex ] @@ -116,8 +112,8 @@ update message model = _ -> model.affected in - ( { model | dnd = dnd, items = items, affected = affected } - , system.commands dnd + ( { model | items = items, affected = affected, dnd = dndModel } + , dndCmd ) ClearAffected -> @@ -139,7 +135,7 @@ view model = ] -itemView : DnDList.Model -> List Int -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> List Int -> Int -> Item -> Html.Html Msg itemView dnd affected index item = let itemId : String @@ -180,7 +176,7 @@ itemView dnd affected index item = [ Html.text item ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -209,7 +205,7 @@ containerStyles = itemStyles : List (Html.Attribute msg) itemStyles = - [ Html.Attributes.style "background-color" "#1e9daa" + [ Html.Attributes.style "background-color" "#44526f" , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" diff --git a/examples/src/DnDList/Single/Movement/Parent.elm b/examples/src/DnDList/Single/Movement/Parent.elm new file mode 100755 index 0000000..186d928 --- /dev/null +++ b/examples/src/DnDList/Single/Movement/Parent.elm @@ -0,0 +1,242 @@ +module DnDList.Single.Movement.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Single.Movement.FreeOnDrag +import DnDList.Single.Movement.FreeOnDrop +import DnDList.Single.Movement.HorizontalOnDrag +import DnDList.Single.Movement.HorizontalOnDrop +import DnDList.Single.Movement.VerticalOnDrag +import DnDList.Single.Movement.VerticalOnDrop +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = FreeOnDrag DnDList.Single.Movement.FreeOnDrag.Model + | FreeOnDrop DnDList.Single.Movement.FreeOnDrop.Model + | HorizontalOnDrag DnDList.Single.Movement.HorizontalOnDrag.Model + | HorizontalOnDrop DnDList.Single.Movement.HorizontalOnDrop.Model + | VerticalOnDrag DnDList.Single.Movement.VerticalOnDrag.Model + | VerticalOnDrop DnDList.Single.Movement.VerticalOnDrop.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ FreeOnDrag DnDList.Single.Movement.FreeOnDrag.initialModel + , FreeOnDrop DnDList.Single.Movement.FreeOnDrop.initialModel + , HorizontalOnDrag DnDList.Single.Movement.HorizontalOnDrag.initialModel + , HorizontalOnDrop DnDList.Single.Movement.HorizontalOnDrop.initialModel + , VerticalOnDrag DnDList.Single.Movement.VerticalOnDrag.initialModel + , VerticalOnDrop DnDList.Single.Movement.VerticalOnDrop.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/FreeOnDrag.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/FreeOnDrop.elm" + + 2 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/HorizontalOnDrag.elm" + + 3 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/HorizontalOnDrop.elm" + + 4 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/VerticalOnDrag.elm" + + 5 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/VerticalOnDrop.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | FreeOnDragMsg DnDList.Single.Movement.FreeOnDrag.Msg + | FreeOnDropMsg DnDList.Single.Movement.FreeOnDrop.Msg + | HorizontalOnDragMsg DnDList.Single.Movement.HorizontalOnDrag.Msg + | HorizontalOnDropMsg DnDList.Single.Movement.HorizontalOnDrop.Msg + | VerticalOnDragMsg DnDList.Single.Movement.VerticalOnDrag.Msg + | VerticalOnDropMsg DnDList.Single.Movement.VerticalOnDrop.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( FreeOnDragMsg msg, FreeOnDrag mo ) -> + stepFreeOnDrag (DnDList.Single.Movement.FreeOnDrag.update msg mo) + + ( FreeOnDropMsg msg, FreeOnDrop mo ) -> + stepFreeOnDrop (DnDList.Single.Movement.FreeOnDrop.update msg mo) + + ( HorizontalOnDragMsg msg, HorizontalOnDrag mo ) -> + stepHorizontalOnDrag (DnDList.Single.Movement.HorizontalOnDrag.update msg mo) + + ( HorizontalOnDropMsg msg, HorizontalOnDrop mo ) -> + stepHorizontalOnDrop (DnDList.Single.Movement.HorizontalOnDrop.update msg mo) + + ( VerticalOnDragMsg msg, VerticalOnDrag mo ) -> + stepVerticalOnDrag (DnDList.Single.Movement.VerticalOnDrag.update msg mo) + + ( VerticalOnDropMsg msg, VerticalOnDrop mo ) -> + stepVerticalOnDrop (DnDList.Single.Movement.VerticalOnDrop.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepFreeOnDrag : ( DnDList.Single.Movement.FreeOnDrag.Model, Cmd DnDList.Single.Movement.FreeOnDrag.Msg ) -> ( Example, Cmd Msg ) +stepFreeOnDrag ( mo, cmds ) = + ( FreeOnDrag mo, Cmd.map FreeOnDragMsg cmds ) + + +stepFreeOnDrop : ( DnDList.Single.Movement.FreeOnDrop.Model, Cmd DnDList.Single.Movement.FreeOnDrop.Msg ) -> ( Example, Cmd Msg ) +stepFreeOnDrop ( mo, cmds ) = + ( FreeOnDrop mo, Cmd.map FreeOnDropMsg cmds ) + + +stepHorizontalOnDrag : ( DnDList.Single.Movement.HorizontalOnDrag.Model, Cmd DnDList.Single.Movement.HorizontalOnDrag.Msg ) -> ( Example, Cmd Msg ) +stepHorizontalOnDrag ( mo, cmds ) = + ( HorizontalOnDrag mo, Cmd.map HorizontalOnDragMsg cmds ) + + +stepHorizontalOnDrop : ( DnDList.Single.Movement.HorizontalOnDrop.Model, Cmd DnDList.Single.Movement.HorizontalOnDrop.Msg ) -> ( Example, Cmd Msg ) +stepHorizontalOnDrop ( mo, cmds ) = + ( HorizontalOnDrop mo, Cmd.map HorizontalOnDropMsg cmds ) + + +stepVerticalOnDrag : ( DnDList.Single.Movement.VerticalOnDrag.Model, Cmd DnDList.Single.Movement.VerticalOnDrag.Msg ) -> ( Example, Cmd Msg ) +stepVerticalOnDrag ( mo, cmds ) = + ( VerticalOnDrag mo, Cmd.map VerticalOnDragMsg cmds ) + + +stepVerticalOnDrop : ( DnDList.Single.Movement.VerticalOnDrop.Model, Cmd DnDList.Single.Movement.VerticalOnDrop.Msg ) -> ( Example, Cmd Msg ) +stepVerticalOnDrop ( mo, cmds ) = + ( VerticalOnDrop mo, Cmd.map VerticalOnDropMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + FreeOnDrag mo -> + Sub.map FreeOnDragMsg (DnDList.Single.Movement.FreeOnDrag.subscriptions mo) + + FreeOnDrop mo -> + Sub.map FreeOnDropMsg (DnDList.Single.Movement.FreeOnDrop.subscriptions mo) + + HorizontalOnDrag mo -> + Sub.map HorizontalOnDragMsg (DnDList.Single.Movement.HorizontalOnDrag.subscriptions mo) + + HorizontalOnDrop mo -> + Sub.map HorizontalOnDropMsg (DnDList.Single.Movement.HorizontalOnDrop.subscriptions mo) + + VerticalOnDrag mo -> + Sub.map VerticalOnDragMsg (DnDList.Single.Movement.VerticalOnDrag.subscriptions mo) + + VerticalOnDrop mo -> + Sub.map VerticalOnDropMsg (DnDList.Single.Movement.VerticalOnDrop.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + FreeOnDrag mo -> + { title = "Free on drag" + , subView = Html.map FreeOnDragMsg (DnDList.Single.Movement.FreeOnDrag.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/FreeOnDrag.elm" + } + + FreeOnDrop mo -> + { title = "Free on drop" + , subView = Html.map FreeOnDropMsg (DnDList.Single.Movement.FreeOnDrop.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/FreeOnDrop.elm" + } + + HorizontalOnDrag mo -> + { title = "Horizontal on drag" + , subView = Html.map HorizontalOnDragMsg (DnDList.Single.Movement.HorizontalOnDrag.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/HorizontalOnDrag.elm" + } + + HorizontalOnDrop mo -> + { title = "Horizontal on drop" + , subView = Html.map HorizontalOnDropMsg (DnDList.Single.Movement.HorizontalOnDrop.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/HorizontalOnDrop.elm" + } + + VerticalOnDrag mo -> + { title = "Vertical on drag" + , subView = Html.map VerticalOnDragMsg (DnDList.Single.Movement.VerticalOnDrag.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/VerticalOnDrag.elm" + } + + VerticalOnDrop mo -> + { title = "Vertical on drop" + , subView = Html.map VerticalOnDropMsg (DnDList.Single.Movement.VerticalOnDrop.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Movement/VerticalOnDrop.elm" + } diff --git a/examples/src/Config/Movement/VerticalOnDrag.elm b/examples/src/DnDList/Single/Movement/VerticalOnDrag.elm similarity index 78% rename from examples/src/Config/Movement/VerticalOnDrag.elm rename to examples/src/DnDList/Single/Movement/VerticalOnDrag.elm index 79b20f7..46f9cf8 100755 --- a/examples/src/Config/Movement/VerticalOnDrag.elm +++ b/examples/src/DnDList/Single/Movement/VerticalOnDrag.elm @@ -1,7 +1,8 @@ -module Config.Movement.VerticalOnDrag exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.Movement.VerticalOnDrag exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -36,21 +37,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Vertical - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.movement DnDList.Vertical + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -58,22 +54,22 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item , affected : List Int + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data , affected = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -91,21 +87,21 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ClearAffected update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd affected : List Int affected = - case system.info dnd of + case system.info dndModel of Just { dragIndex, dropIndex } -> if dragIndex /= dropIndex then dragIndex :: dropIndex :: model.affected @@ -116,8 +112,8 @@ update message model = _ -> model.affected in - ( { model | dnd = dnd, items = items, affected = affected } - , system.commands dnd + ( { model | items = items, affected = affected, dnd = dndModel } + , dndCmd ) ClearAffected -> @@ -139,7 +135,7 @@ view model = ] -itemView : DnDList.Model -> List Int -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> List Int -> Int -> Item -> Html.Html Msg itemView dnd affected index item = let itemId : String @@ -175,7 +171,7 @@ itemView dnd affected index item = [ Html.text item ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -206,8 +202,8 @@ containerStyles = itemStyles : List (Html.Attribute msg) itemStyles = - [ Html.Attributes.style "background-color" "#aa1e9d" - , Html.Attributes.style "border-radius" "8px" + [ Html.Attributes.style "background-color" "#3692c7" + , Html.Attributes.style "border-radius" "4px" , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "font-size" "1.2em" diff --git a/examples/src/Config/Movement/VerticalOnDrop.elm b/examples/src/DnDList/Single/Movement/VerticalOnDrop.elm similarity index 80% rename from examples/src/Config/Movement/VerticalOnDrop.elm rename to examples/src/DnDList/Single/Movement/VerticalOnDrop.elm index f9adfd0..79e3e3d 100755 --- a/examples/src/Config/Movement/VerticalOnDrop.elm +++ b/examples/src/DnDList/Single/Movement/VerticalOnDrop.elm @@ -1,7 +1,8 @@ -module Config.Movement.VerticalOnDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.Movement.VerticalOnDrop exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -36,21 +37,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Vertical - , listen = DnDList.OnDrop - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.movement DnDList.Vertical + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -58,22 +54,22 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item , affected : List Int + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data , affected = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -91,21 +87,21 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ClearAffected update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd affected : List Int affected = - case system.info dnd of + case system.info dndModel of Just { dragIndex, dropIndex } -> if dragIndex /= dropIndex then [ dragIndex, dropIndex ] @@ -116,8 +112,8 @@ update message model = _ -> model.affected in - ( { model | dnd = dnd, items = items, affected = affected } - , system.commands dnd + ( { model | items = items, affected = affected, dnd = dndModel } + , dndCmd ) ClearAffected -> @@ -139,7 +135,7 @@ view model = ] -itemView : DnDList.Model -> List Int -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> List Int -> Int -> Item -> Html.Html Msg itemView dnd affected index item = let itemId : String @@ -180,7 +176,7 @@ itemView dnd affected index item = [ Html.text item ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -211,7 +207,7 @@ containerStyles = itemStyles : List (Html.Attribute msg) itemStyles = - [ Html.Attributes.style "background-color" "#1e9daa" + [ Html.Attributes.style "background-color" "#29506d" , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" diff --git a/examples/src/Config/OperationsOnDrag/InsertAfter.elm b/examples/src/DnDList/Single/OperationsOnDrag/InsertAfter.elm similarity index 79% rename from examples/src/Config/OperationsOnDrag/InsertAfter.elm rename to examples/src/DnDList/Single/OperationsOnDrag/InsertAfter.elm index b79b45e..2f61dd7 100755 --- a/examples/src/Config/OperationsOnDrag/InsertAfter.elm +++ b/examples/src/DnDList/Single/OperationsOnDrag/InsertAfter.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrag.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrag.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.InsertAfter - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.InsertAfter + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -100,20 +96,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -131,20 +127,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -168,7 +164,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -198,7 +194,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -222,22 +218,22 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" affectedColor : String affectedColor = - "purple" + "#eabd00" @@ -256,7 +252,12 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , Html.Attributes.style "color" "#5e81ac" + , if color == baseColor then + Html.Attributes.style "border" "1px solid #a7b5cd" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrag/InsertBefore.elm b/examples/src/DnDList/Single/OperationsOnDrag/InsertBefore.elm similarity index 80% rename from examples/src/Config/OperationsOnDrag/InsertBefore.elm rename to examples/src/DnDList/Single/OperationsOnDrag/InsertBefore.elm index e898510..766786e 100755 --- a/examples/src/Config/OperationsOnDrag/InsertBefore.elm +++ b/examples/src/DnDList/Single/OperationsOnDrag/InsertBefore.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrag.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrag.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.InsertBefore - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.InsertBefore + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -100,20 +96,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -131,20 +127,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -168,7 +164,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -198,7 +194,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -222,22 +218,22 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" affectedColor : String affectedColor = - "purple" + "#eabd00" @@ -256,7 +252,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/DnDList/Single/OperationsOnDrag/Parent.elm b/examples/src/DnDList/Single/OperationsOnDrag/Parent.elm new file mode 100755 index 0000000..9e8ea4d --- /dev/null +++ b/examples/src/DnDList/Single/OperationsOnDrag/Parent.elm @@ -0,0 +1,218 @@ +module DnDList.Single.OperationsOnDrag.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Single.OperationsOnDrag.InsertAfter +import DnDList.Single.OperationsOnDrag.InsertBefore +import DnDList.Single.OperationsOnDrag.Rotate +import DnDList.Single.OperationsOnDrag.Swap +import DnDList.Single.OperationsOnDrag.Unaltered +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = InsertAfter DnDList.Single.OperationsOnDrag.InsertAfter.Model + | InsertBefore DnDList.Single.OperationsOnDrag.InsertBefore.Model + | Rotate DnDList.Single.OperationsOnDrag.Rotate.Model + | Swap DnDList.Single.OperationsOnDrag.Swap.Model + | Unaltered DnDList.Single.OperationsOnDrag.Unaltered.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ InsertAfter DnDList.Single.OperationsOnDrag.InsertAfter.initialModel + , InsertBefore DnDList.Single.OperationsOnDrag.InsertBefore.initialModel + , Rotate DnDList.Single.OperationsOnDrag.Rotate.initialModel + , Swap DnDList.Single.OperationsOnDrag.Swap.initialModel + , Unaltered DnDList.Single.OperationsOnDrag.Unaltered.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/DetectReorder.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/InsertBefore.elm" + + 2 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/Rotate.elm" + + 3 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/DetectReorder.elm" + + 4 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/Unaltered.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | InsertAfterMsg DnDList.Single.OperationsOnDrag.InsertAfter.Msg + | InsertBeforeMsg DnDList.Single.OperationsOnDrag.InsertBefore.Msg + | RotateMsg DnDList.Single.OperationsOnDrag.Rotate.Msg + | SwapMsg DnDList.Single.OperationsOnDrag.Swap.Msg + | UnalteredMsg DnDList.Single.OperationsOnDrag.Unaltered.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( InsertAfterMsg msg, InsertAfter mo ) -> + stepInsertAfter (DnDList.Single.OperationsOnDrag.InsertAfter.update msg mo) + + ( InsertBeforeMsg msg, InsertBefore mo ) -> + stepInsertBefore (DnDList.Single.OperationsOnDrag.InsertBefore.update msg mo) + + ( RotateMsg msg, Rotate mo ) -> + stepRotate (DnDList.Single.OperationsOnDrag.Rotate.update msg mo) + + ( SwapMsg msg, Swap mo ) -> + stepSwap (DnDList.Single.OperationsOnDrag.Swap.update msg mo) + + ( UnalteredMsg msg, Unaltered mo ) -> + stepUnaltered (DnDList.Single.OperationsOnDrag.Unaltered.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepInsertAfter : ( DnDList.Single.OperationsOnDrag.InsertAfter.Model, Cmd DnDList.Single.OperationsOnDrag.InsertAfter.Msg ) -> ( Example, Cmd Msg ) +stepInsertAfter ( mo, cmds ) = + ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) + + +stepInsertBefore : ( DnDList.Single.OperationsOnDrag.InsertBefore.Model, Cmd DnDList.Single.OperationsOnDrag.InsertBefore.Msg ) -> ( Example, Cmd Msg ) +stepInsertBefore ( mo, cmds ) = + ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) + + +stepRotate : ( DnDList.Single.OperationsOnDrag.Rotate.Model, Cmd DnDList.Single.OperationsOnDrag.Rotate.Msg ) -> ( Example, Cmd Msg ) +stepRotate ( mo, cmds ) = + ( Rotate mo, Cmd.map RotateMsg cmds ) + + +stepSwap : ( DnDList.Single.OperationsOnDrag.Swap.Model, Cmd DnDList.Single.OperationsOnDrag.Swap.Msg ) -> ( Example, Cmd Msg ) +stepSwap ( mo, cmds ) = + ( Swap mo, Cmd.map SwapMsg cmds ) + + +stepUnaltered : ( DnDList.Single.OperationsOnDrag.Unaltered.Model, Cmd DnDList.Single.OperationsOnDrag.Unaltered.Msg ) -> ( Example, Cmd Msg ) +stepUnaltered ( mo, cmds ) = + ( Unaltered mo, Cmd.map UnalteredMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + InsertAfter mo -> + Sub.map InsertAfterMsg (DnDList.Single.OperationsOnDrag.InsertAfter.subscriptions mo) + + InsertBefore mo -> + Sub.map InsertBeforeMsg (DnDList.Single.OperationsOnDrag.InsertBefore.subscriptions mo) + + Rotate mo -> + Sub.map RotateMsg (DnDList.Single.OperationsOnDrag.Rotate.subscriptions mo) + + Swap mo -> + Sub.map SwapMsg (DnDList.Single.OperationsOnDrag.Swap.subscriptions mo) + + Unaltered mo -> + Sub.map UnalteredMsg (DnDList.Single.OperationsOnDrag.Unaltered.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + InsertAfter mo -> + { title = "Insert after" + , subView = Html.map InsertAfterMsg (DnDList.Single.OperationsOnDrag.InsertAfter.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/DetectReorder.elm" + } + + InsertBefore mo -> + { title = "Insert before" + , subView = Html.map InsertBeforeMsg (DnDList.Single.OperationsOnDrag.InsertBefore.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/InsertBefore.elm" + } + + Rotate mo -> + { title = "Rotate" + , subView = Html.map RotateMsg (DnDList.Single.OperationsOnDrag.Rotate.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/Rotate.elm" + } + + Swap mo -> + { title = "Swap" + , subView = Html.map SwapMsg (DnDList.Single.OperationsOnDrag.Swap.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/DetectReorder.elm" + } + + Unaltered mo -> + { title = "Unaltered" + , subView = Html.map UnalteredMsg (DnDList.Single.OperationsOnDrag.Unaltered.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrag/Unaltered.elm" + } diff --git a/examples/src/Config/OperationsOnDrag/Rotate.elm b/examples/src/DnDList/Single/OperationsOnDrag/Rotate.elm similarity index 79% rename from examples/src/Config/OperationsOnDrag/Rotate.elm rename to examples/src/DnDList/Single/OperationsOnDrag/Rotate.elm index 809b519..dd08e80 100755 --- a/examples/src/Config/OperationsOnDrag/Rotate.elm +++ b/examples/src/DnDList/Single/OperationsOnDrag/Rotate.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrag.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrag.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Rotate - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Rotate + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -100,20 +96,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -131,20 +127,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -168,7 +164,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -193,7 +189,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -217,22 +213,22 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" affectedColor : String affectedColor = - "purple" + "#eabd00" @@ -251,7 +247,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrag/Swap.elm b/examples/src/DnDList/Single/OperationsOnDrag/Swap.elm similarity index 77% rename from examples/src/Config/OperationsOnDrag/Swap.elm rename to examples/src/DnDList/Single/OperationsOnDrag/Swap.elm index b8eca82..5c17413 100755 --- a/examples/src/Config/OperationsOnDrag/Swap.elm +++ b/examples/src/DnDList/Single/OperationsOnDrag/Swap.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrag.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrag.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -80,20 +76,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -111,20 +107,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -148,7 +144,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -173,7 +169,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -197,17 +193,17 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" @@ -226,7 +222,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrag/Unaltered.elm b/examples/src/DnDList/Single/OperationsOnDrag/Unaltered.elm similarity index 78% rename from examples/src/Config/OperationsOnDrag/Unaltered.elm rename to examples/src/DnDList/Single/OperationsOnDrag/Unaltered.elm index 2ad3608..41a3a73 100755 --- a/examples/src/Config/OperationsOnDrag/Unaltered.elm +++ b/examples/src/DnDList/Single/OperationsOnDrag/Unaltered.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrag.Unaltered exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrag.Unaltered exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Unaltered - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Unaltered + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -80,20 +76,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -111,20 +107,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -148,7 +144,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -178,7 +174,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -202,17 +198,17 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" @@ -231,7 +227,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrop/InsertAfter.elm b/examples/src/DnDList/Single/OperationsOnDrop/InsertAfter.elm similarity index 80% rename from examples/src/Config/OperationsOnDrop/InsertAfter.elm rename to examples/src/DnDList/Single/OperationsOnDrop/InsertAfter.elm index 7bc192c..d89f50e 100755 --- a/examples/src/Config/OperationsOnDrop/InsertAfter.elm +++ b/examples/src/DnDList/Single/OperationsOnDrop/InsertAfter.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrop.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrop.InsertAfter exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.InsertAfter - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.InsertAfter + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -100,20 +96,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -131,20 +127,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -168,7 +164,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -198,7 +194,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -222,22 +218,22 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" affectedColor : String affectedColor = - "purple" + "#eabd00" @@ -256,7 +252,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrop/InsertBefore.elm b/examples/src/DnDList/Single/OperationsOnDrop/InsertBefore.elm similarity index 80% rename from examples/src/Config/OperationsOnDrop/InsertBefore.elm rename to examples/src/DnDList/Single/OperationsOnDrop/InsertBefore.elm index 433272b..21e479a 100755 --- a/examples/src/Config/OperationsOnDrop/InsertBefore.elm +++ b/examples/src/DnDList/Single/OperationsOnDrop/InsertBefore.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrop.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrop.InsertBefore exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.InsertBefore - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.InsertBefore + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -100,20 +96,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -131,20 +127,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -168,7 +164,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -198,7 +194,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -222,22 +218,22 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" affectedColor : String affectedColor = - "purple" + "#eabd00" @@ -256,7 +252,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/DnDList/Single/OperationsOnDrop/Parent.elm b/examples/src/DnDList/Single/OperationsOnDrop/Parent.elm new file mode 100755 index 0000000..01a6285 --- /dev/null +++ b/examples/src/DnDList/Single/OperationsOnDrop/Parent.elm @@ -0,0 +1,218 @@ +module DnDList.Single.OperationsOnDrop.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Single.OperationsOnDrop.InsertAfter +import DnDList.Single.OperationsOnDrop.InsertBefore +import DnDList.Single.OperationsOnDrop.Rotate +import DnDList.Single.OperationsOnDrop.Swap +import DnDList.Single.OperationsOnDrop.Unaltered +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = InsertAfter DnDList.Single.OperationsOnDrop.InsertAfter.Model + | InsertBefore DnDList.Single.OperationsOnDrop.InsertBefore.Model + | Rotate DnDList.Single.OperationsOnDrop.Rotate.Model + | Swap DnDList.Single.OperationsOnDrop.Swap.Model + | Unaltered DnDList.Single.OperationsOnDrop.Unaltered.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ InsertAfter DnDList.Single.OperationsOnDrop.InsertAfter.initialModel + , InsertBefore DnDList.Single.OperationsOnDrop.InsertBefore.initialModel + , Rotate DnDList.Single.OperationsOnDrop.Rotate.initialModel + , Swap DnDList.Single.OperationsOnDrop.Swap.initialModel + , Unaltered DnDList.Single.OperationsOnDrop.Unaltered.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/DetectReorder.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/InsertBefore.elm" + + 2 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/Rotate.elm" + + 3 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/DetectReorder.elm" + + 4 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/Unaltered.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | InsertAfterMsg DnDList.Single.OperationsOnDrop.InsertAfter.Msg + | InsertBeforeMsg DnDList.Single.OperationsOnDrop.InsertBefore.Msg + | RotateMsg DnDList.Single.OperationsOnDrop.Rotate.Msg + | SwapMsg DnDList.Single.OperationsOnDrop.Swap.Msg + | UnalteredMsg DnDList.Single.OperationsOnDrop.Unaltered.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( InsertAfterMsg msg, InsertAfter mo ) -> + stepInsertAfter (DnDList.Single.OperationsOnDrop.InsertAfter.update msg mo) + + ( InsertBeforeMsg msg, InsertBefore mo ) -> + stepInsertBefore (DnDList.Single.OperationsOnDrop.InsertBefore.update msg mo) + + ( RotateMsg msg, Rotate mo ) -> + stepRotate (DnDList.Single.OperationsOnDrop.Rotate.update msg mo) + + ( SwapMsg msg, Swap mo ) -> + stepSwap (DnDList.Single.OperationsOnDrop.Swap.update msg mo) + + ( UnalteredMsg msg, Unaltered mo ) -> + stepUnaltered (DnDList.Single.OperationsOnDrop.Unaltered.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepInsertAfter : ( DnDList.Single.OperationsOnDrop.InsertAfter.Model, Cmd DnDList.Single.OperationsOnDrop.InsertAfter.Msg ) -> ( Example, Cmd Msg ) +stepInsertAfter ( mo, cmds ) = + ( InsertAfter mo, Cmd.map InsertAfterMsg cmds ) + + +stepInsertBefore : ( DnDList.Single.OperationsOnDrop.InsertBefore.Model, Cmd DnDList.Single.OperationsOnDrop.InsertBefore.Msg ) -> ( Example, Cmd Msg ) +stepInsertBefore ( mo, cmds ) = + ( InsertBefore mo, Cmd.map InsertBeforeMsg cmds ) + + +stepRotate : ( DnDList.Single.OperationsOnDrop.Rotate.Model, Cmd DnDList.Single.OperationsOnDrop.Rotate.Msg ) -> ( Example, Cmd Msg ) +stepRotate ( mo, cmds ) = + ( Rotate mo, Cmd.map RotateMsg cmds ) + + +stepSwap : ( DnDList.Single.OperationsOnDrop.Swap.Model, Cmd DnDList.Single.OperationsOnDrop.Swap.Msg ) -> ( Example, Cmd Msg ) +stepSwap ( mo, cmds ) = + ( Swap mo, Cmd.map SwapMsg cmds ) + + +stepUnaltered : ( DnDList.Single.OperationsOnDrop.Unaltered.Model, Cmd DnDList.Single.OperationsOnDrop.Unaltered.Msg ) -> ( Example, Cmd Msg ) +stepUnaltered ( mo, cmds ) = + ( Unaltered mo, Cmd.map UnalteredMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + InsertAfter mo -> + Sub.map InsertAfterMsg (DnDList.Single.OperationsOnDrop.InsertAfter.subscriptions mo) + + InsertBefore mo -> + Sub.map InsertBeforeMsg (DnDList.Single.OperationsOnDrop.InsertBefore.subscriptions mo) + + Rotate mo -> + Sub.map RotateMsg (DnDList.Single.OperationsOnDrop.Rotate.subscriptions mo) + + Swap mo -> + Sub.map SwapMsg (DnDList.Single.OperationsOnDrop.Swap.subscriptions mo) + + Unaltered mo -> + Sub.map UnalteredMsg (DnDList.Single.OperationsOnDrop.Unaltered.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + InsertAfter mo -> + { title = "Insert after" + , subView = Html.map InsertAfterMsg (DnDList.Single.OperationsOnDrop.InsertAfter.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/DetectReorder.elm" + } + + InsertBefore mo -> + { title = "Insert before" + , subView = Html.map InsertBeforeMsg (DnDList.Single.OperationsOnDrop.InsertBefore.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/InsertBefore.elm" + } + + Rotate mo -> + { title = "Rotate" + , subView = Html.map RotateMsg (DnDList.Single.OperationsOnDrop.Rotate.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/Rotate.elm" + } + + Swap mo -> + { title = "Swap" + , subView = Html.map SwapMsg (DnDList.Single.OperationsOnDrop.Swap.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/DetectReorder.elm" + } + + Unaltered mo -> + { title = "Unaltered" + , subView = Html.map UnalteredMsg (DnDList.Single.OperationsOnDrop.Unaltered.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/OperationsOnDrop/Unaltered.elm" + } diff --git a/examples/src/Config/OperationsOnDrop/Rotate.elm b/examples/src/DnDList/Single/OperationsOnDrop/Rotate.elm similarity index 80% rename from examples/src/Config/OperationsOnDrop/Rotate.elm rename to examples/src/DnDList/Single/OperationsOnDrop/Rotate.elm index 384dbdd..f7bdc84 100755 --- a/examples/src/Config/OperationsOnDrop/Rotate.elm +++ b/examples/src/DnDList/Single/OperationsOnDrop/Rotate.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrop.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrop.Rotate exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Rotate - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Rotate + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -100,20 +96,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -131,20 +127,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -168,7 +164,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -198,7 +194,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -222,22 +218,22 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" affectedColor : String affectedColor = - "purple" + "#eabd00" @@ -256,7 +252,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrop/Swap.elm b/examples/src/DnDList/Single/OperationsOnDrop/Swap.elm similarity index 78% rename from examples/src/Config/OperationsOnDrop/Swap.elm rename to examples/src/DnDList/Single/OperationsOnDrop/Swap.elm index 906e73b..41919e4 100755 --- a/examples/src/Config/OperationsOnDrop/Swap.elm +++ b/examples/src/DnDList/Single/OperationsOnDrop/Swap.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrop.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrop.Swap exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -80,20 +76,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -111,20 +107,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -148,7 +144,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -178,7 +174,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -202,17 +198,17 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" @@ -231,7 +227,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Config/OperationsOnDrop/Unaltered.elm b/examples/src/DnDList/Single/OperationsOnDrop/Unaltered.elm similarity index 78% rename from examples/src/Config/OperationsOnDrop/Unaltered.elm rename to examples/src/DnDList/Single/OperationsOnDrop/Unaltered.elm index 700f8b0..f44c468 100755 --- a/examples/src/Config/OperationsOnDrop/Unaltered.elm +++ b/examples/src/DnDList/Single/OperationsOnDrop/Unaltered.elm @@ -1,7 +1,8 @@ -module Config.OperationsOnDrop.Unaltered exposing (Model, Msg, initialModel, main, subscriptions, update, view) +module DnDList.Single.OperationsOnDrop.Unaltered exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Events @@ -38,21 +39,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Unaltered - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Unaltered + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Item -> List Item @@ -80,20 +76,20 @@ beforeUpdate dragIndex dropIndex items = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -111,20 +107,20 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg | ResetColors update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) ResetColors -> @@ -148,7 +144,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index { value, color } = let itemId : String @@ -178,7 +174,7 @@ itemView dnd index { value, color } = [ Html.text value ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -202,17 +198,17 @@ ghostView dnd items = baseColor : String baseColor = - "dimgray" + "transparent" dragColor : String dragColor = - "red" + "#3692c7" dropColor : String dropColor = - "green" + "#44526f" @@ -231,7 +227,11 @@ containerStyles = itemStyles : String -> List (Html.Attribute msg) itemStyles color = [ Html.Attributes.style "background-color" color - , Html.Attributes.style "color" "white" + , if color == baseColor then + Html.Attributes.style "border" "1px solid gray" + + else + Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/DnDList/Single/Parent.elm b/examples/src/DnDList/Single/Parent.elm new file mode 100755 index 0000000..b962ead --- /dev/null +++ b/examples/src/DnDList/Single/Parent.elm @@ -0,0 +1,289 @@ +module DnDList.Single.Parent exposing + ( Example + , Msg + , chapterView + , init + , subscriptions + , update + , view + ) + +import AssocList +import CustomElement +import Dict +import DnDList.Single.HookCommands.Parent +import DnDList.Single.Movement.Parent +import DnDList.Single.OperationsOnDrag.Parent +import DnDList.Single.OperationsOnDrop.Parent +import DnDList.Single.Scroll.Parent +import Html +import Views + + + +-- WORKAROUND ENUM TYPE + + +defaultMeta : Views.Metadata Example +defaultMeta = + { segment = "operations-drag" + , title = "Operations on drag" + , description = "Compare the list operations sorting on drag" + , link = "" + , initialModel = OperationsOnDrag DnDList.Single.OperationsOnDrag.Parent.initialModel + } + + +meta : List (Views.Metadata Example) +meta = + [ defaultMeta + , { segment = "operations-drop" + , title = "Operations on drop" + , description = "Compare the list operations sorting on drop" + , link = "" + , initialModel = OperationsOnDrop DnDList.Single.OperationsOnDrop.Parent.initialModel + } + , { segment = "hook-commands" + , title = "Hook commands" + , description = "Compare detectDrop and detectReorder hooks" + , link = "" + , initialModel = HookCommands DnDList.Single.HookCommands.Parent.initialModel + } + , { segment = "movement" + , title = "Movement" + , description = "The behavior of the Free, Horizontal only and Vertical only drag movements with Swap list operation" + , link = "" + , initialModel = Movement DnDList.Single.Movement.Parent.initialModel + } + , { segment = "scroll" + , title = "Scroll" + , description = "Customize scrollable containers and areas" + , link = "" + , initialModel = Scroll DnDList.Single.Scroll.Parent.initialModel + } + ] + + +type Tag + = OperationsOnDragTag + | OperationsOnDropTag + | HookCommandsTag + | MovementTag + | ScrollTag + + +allTags : List Tag +allTags = + let + ignored : Tag -> () + ignored tag = + case tag of + OperationsOnDragTag -> + () + + OperationsOnDropTag -> + () + + HookCommandsTag -> + () + + MovementTag -> + () + + ScrollTag -> + () + in + [ OperationsOnDragTag + , OperationsOnDropTag + , HookCommandsTag + , MovementTag + , ScrollTag + ] + + +exampleToTag : Example -> Tag +exampleToTag example = + case example of + OperationsOnDrag _ -> + OperationsOnDragTag + + OperationsOnDrop _ -> + OperationsOnDropTag + + HookCommands _ -> + HookCommandsTag + + Movement _ -> + MovementTag + + Scroll _ -> + ScrollTag + + +tagSegmentDict : AssocList.Dict Tag (Views.Metadata Example) +tagSegmentDict = + List.map2 Tuple.pair allTags meta |> AssocList.fromList + + +tagToMetadata : Tag -> Views.Metadata Example +tagToMetadata tag = + Maybe.withDefault defaultMeta <| + case tag of + OperationsOnDragTag -> + AssocList.get OperationsOnDragTag tagSegmentDict + + OperationsOnDropTag -> + AssocList.get OperationsOnDropTag tagSegmentDict + + HookCommandsTag -> + AssocList.get HookCommandsTag tagSegmentDict + + MovementTag -> + AssocList.get MovementTag tagSegmentDict + + ScrollTag -> + AssocList.get ScrollTag tagSegmentDict + + + +-- MODEL + + +type Example + = OperationsOnDrag DnDList.Single.OperationsOnDrag.Parent.Model + | OperationsOnDrop DnDList.Single.OperationsOnDrop.Parent.Model + | HookCommands DnDList.Single.HookCommands.Parent.Model + | Movement DnDList.Single.Movement.Parent.Model + | Scroll DnDList.Single.Scroll.Parent.Model + + +init : String -> ( Example, Cmd Msg ) +init segment = + ( meta + |> List.map (\m -> ( m.segment, m.initialModel )) + |> Dict.fromList + |> Dict.get segment + |> Maybe.withDefault defaultMeta.initialModel + , Cmd.none + ) + + + +-- UPDATE + + +type Msg + = OperationsOnDragMsg DnDList.Single.OperationsOnDrag.Parent.Msg + | OperationsOnDropMsg DnDList.Single.OperationsOnDrop.Parent.Msg + | HookCommandsMsg DnDList.Single.HookCommands.Parent.Msg + | MovementMsg DnDList.Single.Movement.Parent.Msg + | ScrollMsg DnDList.Single.Scroll.Parent.Msg + + +subscriptions : Example -> Sub Msg +subscriptions model = + case model of + OperationsOnDrag subModel -> + Sub.map OperationsOnDragMsg (DnDList.Single.OperationsOnDrag.Parent.subscriptions subModel) + + OperationsOnDrop subModel -> + Sub.map OperationsOnDropMsg (DnDList.Single.OperationsOnDrop.Parent.subscriptions subModel) + + HookCommands subModel -> + Sub.map HookCommandsMsg (DnDList.Single.HookCommands.Parent.subscriptions subModel) + + Movement subModel -> + Sub.map MovementMsg (DnDList.Single.Movement.Parent.subscriptions subModel) + + Scroll subModel -> + Sub.map ScrollMsg (DnDList.Single.Scroll.Parent.subscriptions subModel) + + +update : Msg -> Example -> ( Example, Cmd Msg ) +update msg model = + case ( msg, model ) of + ( OperationsOnDragMsg subMsg, OperationsOnDrag subModel ) -> + stepOperationsOnDrag (DnDList.Single.OperationsOnDrag.Parent.update subMsg subModel) + + ( OperationsOnDropMsg subMsg, OperationsOnDrop subModel ) -> + stepOperationsOnDrop (DnDList.Single.OperationsOnDrop.Parent.update subMsg subModel) + + ( HookCommandsMsg subMsg, HookCommands subModel ) -> + stepHookCommands (DnDList.Single.HookCommands.Parent.update subMsg subModel) + + ( MovementMsg subMsg, Movement subModel ) -> + stepMovement (DnDList.Single.Movement.Parent.update subMsg subModel) + + ( ScrollMsg subMsg, Scroll subModel ) -> + stepScroll (DnDList.Single.Scroll.Parent.update subMsg subModel) + + _ -> + ( model, Cmd.none ) + + +stepOperationsOnDrag : ( DnDList.Single.OperationsOnDrag.Parent.Model, Cmd DnDList.Single.OperationsOnDrag.Parent.Msg ) -> ( Example, Cmd Msg ) +stepOperationsOnDrag ( subModel, subCmd ) = + ( OperationsOnDrag subModel, Cmd.map OperationsOnDragMsg subCmd ) + + +stepOperationsOnDrop : ( DnDList.Single.OperationsOnDrop.Parent.Model, Cmd DnDList.Single.OperationsOnDrop.Parent.Msg ) -> ( Example, Cmd Msg ) +stepOperationsOnDrop ( subModel, subCmd ) = + ( OperationsOnDrop subModel, Cmd.map OperationsOnDropMsg subCmd ) + + +stepHookCommands : ( DnDList.Single.HookCommands.Parent.Model, Cmd DnDList.Single.HookCommands.Parent.Msg ) -> ( Example, Cmd Msg ) +stepHookCommands ( subModel, subCmd ) = + ( HookCommands subModel, Cmd.map HookCommandsMsg subCmd ) + + +stepMovement : ( DnDList.Single.Movement.Parent.Model, Cmd DnDList.Single.Movement.Parent.Msg ) -> ( Example, Cmd Msg ) +stepMovement ( subModel, subCmd ) = + ( Movement subModel, Cmd.map MovementMsg subCmd ) + + +stepScroll : ( DnDList.Single.Scroll.Parent.Model, Cmd DnDList.Single.Scroll.Parent.Msg ) -> ( Example, Cmd Msg ) +stepScroll ( subModel, subCmd ) = + ( Scroll subModel, Cmd.map ScrollMsg subCmd ) + + + +-- VIEW + + +view : Example -> List (Html.Html Msg) +view example = + [ Views.demoHeaderView + (example + |> exampleToTag + |> tagToMetadata + |> (\m -> { title = m.title, description = m.description, link = m.link }) + ) + , case example of + OperationsOnDrag subModel -> + Html.map OperationsOnDragMsg (DnDList.Single.OperationsOnDrag.Parent.view subModel) + + OperationsOnDrop subModel -> + Html.map OperationsOnDropMsg (DnDList.Single.OperationsOnDrop.Parent.view subModel) + + HookCommands subModel -> + Html.map HookCommandsMsg (DnDList.Single.HookCommands.Parent.view subModel) + + Movement subModel -> + Html.map MovementMsg (DnDList.Single.Movement.Parent.view subModel) + + Scroll subModel -> + Html.map ScrollMsg (DnDList.Single.Scroll.Parent.view subModel) + , CustomElement.elmCode + [ CustomElement.href (example |> exampleToTag |> tagToMetadata |> (\m -> m.link)) ] + [] + ] + + +chapterView : String -> Html.Html msg +chapterView class = + Views.chapterView + class + { title = "DnDList.Single" + , slug = "single" + , allTags = allTags |> List.map (tagToMetadata >> (\m -> { segment = m.segment, title = m.title })) + } diff --git a/examples/src/DnDList/Single/Scroll/Parent.elm b/examples/src/DnDList/Single/Scroll/Parent.elm new file mode 100755 index 0000000..26c2f7c --- /dev/null +++ b/examples/src/DnDList/Single/Scroll/Parent.elm @@ -0,0 +1,170 @@ +module DnDList.Single.Scroll.Parent exposing + ( Model + , Msg + , init + , initialModel + , subscriptions + , update + , url + , view + ) + +import DnDList.Single.Scroll.Scroll +import DnDList.Single.Scroll.ScrollWithOffset +import DnDList.Single.Scroll.ScrollWithOffsetAndWall +import Html +import Views + + + +-- MODEL + + +type alias Model = + { id : Int + , examples : List Example + } + + +type Example + = Scroll DnDList.Single.Scroll.Scroll.Model + | ScrollWithOffset DnDList.Single.Scroll.ScrollWithOffset.Model + | ScrollWithOffsetAndWall DnDList.Single.Scroll.ScrollWithOffsetAndWall.Model + + +initialModel : Model +initialModel = + { id = 0 + , examples = + [ Scroll DnDList.Single.Scroll.Scroll.initialModel + , ScrollWithOffset DnDList.Single.Scroll.ScrollWithOffset.initialModel + , ScrollWithOffsetAndWall DnDList.Single.Scroll.ScrollWithOffsetAndWall.initialModel + ] + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + +url : Int -> String +url id = + case id of + 0 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Scroll/Horizontal.elm" + + 1 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Scroll/Vertical.elm" + + 2 -> + "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Scroll/Table.elm" + + _ -> + "" + + + +-- UPDATE + + +type Msg + = LinkClicked Int + | ScrollMsg DnDList.Single.Scroll.Scroll.Msg + | ScrollWithOffsetMsg DnDList.Single.Scroll.ScrollWithOffset.Msg + | ScrollWithOffsetAndWallMsg DnDList.Single.Scroll.ScrollWithOffsetAndWall.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update message model = + case message of + LinkClicked id -> + ( { model | id = id }, Cmd.none ) + + _ -> + model.examples + |> List.map + (\example -> + case ( message, example ) of + ( ScrollMsg msg, Scroll mo ) -> + stepScroll (DnDList.Single.Scroll.Scroll.update msg mo) + + ( ScrollWithOffsetMsg msg, ScrollWithOffset mo ) -> + stepScrollWithOffset (DnDList.Single.Scroll.ScrollWithOffset.update msg mo) + + ( ScrollWithOffsetAndWallMsg msg, ScrollWithOffsetAndWall mo ) -> + stepScrollWithOffsetAndWall (DnDList.Single.Scroll.ScrollWithOffsetAndWall.update msg mo) + + _ -> + ( example, Cmd.none ) + ) + |> List.unzip + |> (\( examples, cmds ) -> ( { model | examples = examples }, Cmd.batch cmds )) + + +stepScroll : ( DnDList.Single.Scroll.Scroll.Model, Cmd DnDList.Single.Scroll.Scroll.Msg ) -> ( Example, Cmd Msg ) +stepScroll ( mo, cmds ) = + ( Scroll mo, Cmd.map ScrollMsg cmds ) + + +stepScrollWithOffset : ( DnDList.Single.Scroll.ScrollWithOffset.Model, Cmd DnDList.Single.Scroll.ScrollWithOffset.Msg ) -> ( Example, Cmd Msg ) +stepScrollWithOffset ( mo, cmds ) = + ( ScrollWithOffset mo, Cmd.map ScrollWithOffsetMsg cmds ) + + +stepScrollWithOffsetAndWall : ( DnDList.Single.Scroll.ScrollWithOffsetAndWall.Model, Cmd DnDList.Single.Scroll.ScrollWithOffsetAndWall.Msg ) -> ( Example, Cmd Msg ) +stepScrollWithOffsetAndWall ( mo, cmds ) = + ( ScrollWithOffsetAndWall mo, Cmd.map ScrollWithOffsetAndWallMsg cmds ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + model.examples + |> List.map + (\example -> + case example of + Scroll mo -> + Sub.map ScrollMsg (DnDList.Single.Scroll.Scroll.subscriptions mo) + + ScrollWithOffset mo -> + Sub.map ScrollWithOffsetMsg (DnDList.Single.Scroll.ScrollWithOffset.subscriptions mo) + + ScrollWithOffsetAndWall mo -> + Sub.map ScrollWithOffsetAndWallMsg (DnDList.Single.Scroll.ScrollWithOffsetAndWall.subscriptions mo) + ) + |> Sub.batch + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Views.examplesView LinkClicked info model.id model.examples + + +info : Example -> Views.SubInfo Msg +info example = + case example of + Scroll mo -> + { title = "Simple scroll" + , subView = Html.map ScrollMsg (DnDList.Single.Scroll.Scroll.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Scroll/Horizontal.elm" + } + + ScrollWithOffset mo -> + { title = "Container with offset" + , subView = Html.map ScrollWithOffsetMsg (DnDList.Single.Scroll.ScrollWithOffset.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Scroll/Vertical.elm" + } + + ScrollWithOffsetAndWall mo -> + { title = "Container with offset and wall" + , subView = Html.map ScrollWithOffsetAndWallMsg (DnDList.Single.Scroll.ScrollWithOffsetAndWall.view mo) + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/DnDList/Single/Scroll/Table.elm" + } diff --git a/examples/src/DnDList/Single/Scroll/Scroll.elm b/examples/src/DnDList/Single/Scroll/Scroll.elm new file mode 100644 index 0000000..f7d1d3d --- /dev/null +++ b/examples/src/DnDList/Single/Scroll/Scroll.elm @@ -0,0 +1,185 @@ +module DnDList.Single.Scroll.Scroll exposing (..) + +import Browser +import DnDList +import DnDList.Single +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + String + + +data : List Item +data = + List.range 1 100 |> List.map String.fromInt + + + +-- DND + + +scrollableContainerId : String +scrollableContainerId = + "scrollable-container-scroll" + + +system : DnDList.Single.System Item Msg +system = + DnDList.Single.config + |> DnDList.Single.scroll DnDList.Scroll_X scrollableContainerId + |> DnDList.Single.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , dnd : DnDList.Single.Model + } + + +initialModel : Model +initialModel = + { items = data + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Single.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section + [ Html.Attributes.style "width" "400px" + , Html.Attributes.style "padding" "70px 0" + , if system.info model.dnd /= Nothing then + Html.Attributes.style "cursor" "grabbing" + + else + Html.Attributes.style "cursor" "default" + ] + [ model.items + |> List.indexedMap (itemView model.dnd) + |> Html.div + [ Html.Attributes.id scrollableContainerId + , Html.Attributes.style "width" "400px" + , Html.Attributes.style "overflow" "auto" + , Html.Attributes.style "display" "flex" + ] + , ghostView model.dnd model.items + ] + + +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg +itemView dnd index item = + let + itemId : String + itemId = + "scroll-" ++ item + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.div + (Html.Attributes.id itemId :: itemStyles "#5b84b1" ++ system.dropEvents index itemId) + [ Html.text item ] + + else + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "color" "#bbbbbb" ] ++ itemStyles "#bbbbbb") + [ Html.text item ] + + Nothing -> + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "cursor" "grab" ] ++ itemStyles "#5b84b1" ++ system.dragEvents index itemId) + [ Html.text item ] + + +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg +ghostView dnd items = + let + maybeDragItem : Maybe Item + maybeDragItem = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + in + case maybeDragItem of + Just item -> + Html.div + (system.ghostStyles dnd ++ itemStyles "#d64161") + [ Html.text item ] + + Nothing -> + Html.text "" + + + +-- STYLES + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "padding" "1rem" + , Html.Attributes.style "border" "1px solid #bbbbbb" + , Html.Attributes.style "background-color" color + , Html.Attributes.style "box-sizing" "border-box" + ] diff --git a/examples/src/DnDList/Single/Scroll/ScrollWithOffset.elm b/examples/src/DnDList/Single/Scroll/ScrollWithOffset.elm new file mode 100644 index 0000000..a5e79f4 --- /dev/null +++ b/examples/src/DnDList/Single/Scroll/ScrollWithOffset.elm @@ -0,0 +1,185 @@ +module DnDList.Single.Scroll.ScrollWithOffset exposing (..) + +import Browser +import DnDList +import DnDList.Single +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + String + + +data : List Item +data = + List.range 1 100 |> List.map String.fromInt + + + +-- DND + + +scrollableContainerId : String +scrollableContainerId = + "scrollable-container-scrollwithoffset" + + +system : DnDList.Single.System Item Msg +system = + DnDList.Single.config + |> DnDList.Single.scrollWithOffset { top = 0, right = -60, bottom = 0, left = -60 } DnDList.Scroll_X scrollableContainerId + |> DnDList.Single.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , dnd : DnDList.Single.Model + } + + +initialModel : Model +initialModel = + { items = data + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Single.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section + [ Html.Attributes.style "width" "400px" + , Html.Attributes.style "padding" "70px 0" + , if system.info model.dnd /= Nothing then + Html.Attributes.style "cursor" "grabbing" + + else + Html.Attributes.style "cursor" "default" + ] + [ model.items + |> List.indexedMap (itemView model.dnd) + |> Html.div + [ Html.Attributes.id scrollableContainerId + , Html.Attributes.style "width" "400px" + , Html.Attributes.style "overflow" "auto" + , Html.Attributes.style "display" "flex" + ] + , ghostView model.dnd model.items + ] + + +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg +itemView dnd index item = + let + itemId : String + itemId = + "scrollwithoffset-" ++ item + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.div + (Html.Attributes.id itemId :: itemStyles "#5b84b1" ++ system.dropEvents index itemId) + [ Html.text item ] + + else + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "color" "#bbbbbb" ] ++ itemStyles "#bbbbbb") + [ Html.text item ] + + Nothing -> + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "cursor" "grab" ] ++ itemStyles "#5b84b1" ++ system.dragEvents index itemId) + [ Html.text item ] + + +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg +ghostView dnd items = + let + maybeDragItem : Maybe Item + maybeDragItem = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + in + case maybeDragItem of + Just item -> + Html.div + (system.ghostStyles dnd ++ itemStyles "#d64161") + [ Html.text item ] + + Nothing -> + Html.text "" + + + +-- STYLES + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "padding" "1rem" + , Html.Attributes.style "border" "1px solid #bbb" + , Html.Attributes.style "background-color" color + , Html.Attributes.style "box-sizing" "border-box" + ] diff --git a/examples/src/DnDList/Single/Scroll/ScrollWithOffsetAndWall.elm b/examples/src/DnDList/Single/Scroll/ScrollWithOffsetAndWall.elm new file mode 100644 index 0000000..a459cae --- /dev/null +++ b/examples/src/DnDList/Single/Scroll/ScrollWithOffsetAndWall.elm @@ -0,0 +1,185 @@ +module DnDList.Single.Scroll.ScrollWithOffsetAndWall exposing (..) + +import Browser +import DnDList +import DnDList.Single +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + String + + +data : List Item +data = + List.range 1 100 |> List.map String.fromInt + + + +-- DND + + +scrollableContainerId : String +scrollableContainerId = + "scrollable-container-scrollwithoffsetandwall" + + +system : DnDList.Single.System Item Msg +system = + DnDList.Single.config + |> DnDList.Single.scrollWithOffsetAndWall { top = 0, right = -60, bottom = 0, left = -60 } DnDList.Scroll_X scrollableContainerId + |> DnDList.Single.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , dnd : DnDList.Single.Model + } + + +initialModel : Model +initialModel = + { items = data + , dnd = system.model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Single.Msg + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section + [ Html.Attributes.style "width" "400px" + , Html.Attributes.style "padding" "70px 0" + , if system.info model.dnd /= Nothing then + Html.Attributes.style "cursor" "grabbing" + + else + Html.Attributes.style "cursor" "default" + ] + [ model.items + |> List.indexedMap (itemView model.dnd) + |> Html.div + [ Html.Attributes.id scrollableContainerId + , Html.Attributes.style "width" "400px" + , Html.Attributes.style "overflow" "auto" + , Html.Attributes.style "display" "flex" + ] + , ghostView model.dnd model.items + ] + + +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg +itemView dnd index item = + let + itemId : String + itemId = + "scrollwithoffsetandwall-" ++ item + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.div + (Html.Attributes.id itemId :: itemStyles "#5b84b1" ++ system.dropEvents index itemId) + [ Html.text item ] + + else + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "color" "#bbbbbb" ] ++ itemStyles "#bbbbbb") + [ Html.text item ] + + Nothing -> + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "cursor" "grab" ] ++ itemStyles "#5b84b1" ++ system.dragEvents index itemId) + [ Html.text item ] + + +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg +ghostView dnd items = + let + maybeDragItem : Maybe Item + maybeDragItem = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + in + case maybeDragItem of + Just item -> + Html.div + (system.ghostStyles dnd ++ itemStyles "#d64161") + [ Html.text item ] + + Nothing -> + Html.text "" + + + +-- STYLES + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "padding" "1rem" + , Html.Attributes.style "border" "1px solid #bbb" + , Html.Attributes.style "background-color" color + , Html.Attributes.style "box-sizing" "border-box" + ] diff --git a/examples/src/Gallery/Hanoi.elm b/examples/src/Gallery/Hanoi.elm index 205b99a..2fdb9e8 100755 --- a/examples/src/Gallery/Hanoi.elm +++ b/examples/src/Gallery/Hanoi.elm @@ -2,6 +2,7 @@ module Gallery.Hanoi exposing (Model, Msg, initialModel, main, subscriptions, up import Browser import DnDList +import DnDList.Single import Html import Html.Attributes @@ -45,21 +46,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Disk -config = - { beforeUpdate = updateTower - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.InsertAfter - } - - -system : DnDList.System Disk Msg +system : DnDList.Single.System Disk Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.InsertAfter + |> DnDList.Single.setItemsBeforeReorder updateTower + |> DnDList.Single.create DnDMsg updateTower : Int -> Int -> List Disk -> List Disk @@ -89,22 +85,22 @@ updateTower dragIndex dropIndex list = type alias Model = - { dnd : DnDList.Model - , disks : List Disk + { disks : List Disk , solved : Bool + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , disks = data + { disks = data , solved = False + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -122,23 +118,23 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, disks ) = - system.update msg model.dnd model.disks + ( disks, dndModel, dndCmd ) = + system.update model.disks dndMsg model.dnd solved : Bool solved = disks |> List.take 3 |> List.all (\disk -> disk.startColor == "transparent") in - ( { model | dnd = dnd, disks = disks, solved = solved } - , system.commands dnd + ( { model | disks = disks, solved = solved, dnd = dndModel } + , dndCmd ) @@ -289,7 +285,7 @@ calculateOffset index tower list = calculateOffset (index + 1) tower xs -maybeDragDisk : DnDList.Model -> List Disk -> Maybe Disk +maybeDragDisk : DnDList.Single.Model -> List Disk -> Maybe Disk maybeDragDisk dnd disks = system.info dnd |> Maybe.andThen (\{ dragIndex } -> disks |> List.drop dragIndex |> List.head) diff --git a/examples/src/Gallery/Knight.elm b/examples/src/Gallery/Knight.elm index 2b1de36..180fa6c 100644 --- a/examples/src/Gallery/Knight.elm +++ b/examples/src/Gallery/Knight.elm @@ -3,6 +3,7 @@ module Gallery.Knight exposing (Model, Msg, initialModel, main, subscriptions, u import Bitwise import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Path @@ -63,21 +64,16 @@ knightMoves = --- SYSTEM +-- DND -config : DnDList.Config Square -config = - { beforeUpdate = beforeUpdate - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Swap - } - - -system : DnDList.System Square Msg +system : DnDList.Single.System Square Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.setItemsBeforeReorder beforeUpdate + |> DnDList.Single.create DnDMsg beforeUpdate : Int -> Int -> List Square -> List Square @@ -103,7 +99,7 @@ beforeUpdate dragIndex dropIndex squares = type alias Model = { squares : List Square , solved : Bool - , dnd : DnDList.Model + , dnd : DnDList.Single.Model } @@ -116,7 +112,7 @@ initialModel = init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -134,23 +130,23 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, squares ) = - system.update msg model.dnd model.squares + ( squares, dndModel, dndCmd ) = + system.update model.squares dndMsg model.dnd solved : Bool solved = (squares |> List.filter (\square -> square == "×") |> List.length) == 24 in - ( { model | squares = squares, solved = solved, dnd = dnd } - , system.commands dnd + ( { model | squares = squares, solved = solved, dnd = dndModel } + , dndCmd ) @@ -168,7 +164,7 @@ view model = ] -squareView : DnDList.Model -> Bool -> Int -> ( Int, Square ) -> Html.Html Msg +squareView : DnDList.Single.Model -> Bool -> Int -> ( Int, Square ) -> Html.Html Msg squareView dnd solved index5 ( index8, square ) = let id : String @@ -229,7 +225,7 @@ squareView dnd solved index5 ( index8, square ) = [ Html.text square ] -ghostView : DnDList.Model -> List Square -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Square -> Html.Html Msg ghostView dnd squares = let maybeDragSquare : Maybe Square diff --git a/examples/src/Gallery/Parent.elm b/examples/src/Gallery/Parent.elm new file mode 100755 index 0000000..273f773 --- /dev/null +++ b/examples/src/Gallery/Parent.elm @@ -0,0 +1,329 @@ +module Gallery.Parent exposing + ( Example + , Msg + , chapterView + , init + , subscriptions + , update + , view + ) + +import AssocList +import CustomElement +import Dict +import Gallery.Hanoi +import Gallery.Knight +import Gallery.Puzzle +import Gallery.Shapes +import Gallery.TaskBoard +import Gallery.TryOn +import Global +import Html +import Views + + + +-- WORKAROUND ENUM TYPE + + +defaultMeta : Views.Metadata Example +defaultMeta = + { segment = "hanoi" + , title = "Towers of Hanoi" + , description = "Single list with auxiliary items." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Hanoi.elm" + , initialModel = Hanoi Gallery.Hanoi.initialModel + } + + +meta : List (Views.Metadata Example) +meta = + [ defaultMeta + , { segment = "puzzle" + , title = "Puzzle" + , description = "List with groups without auxiliary items." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Puzzle.elm" + , initialModel = Puzzle Gallery.Puzzle.initialModel + } + , { segment = "shapes" + , title = "Geometric shapes" + , description = "Single list with the Unaltered operation and beforeUpdate." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Shapes.elm" + , initialModel = Shapes Gallery.Shapes.initialModel + } + , { segment = "knight" + , title = "Knight's tour" + , description = "Single list with Swap. The top-left 5 × 5 sub-board is diced from the original 8 × 8 board." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Knight.elm" + , initialModel = Knight Gallery.Knight.initialModel + } + , { segment = "try-on" + , title = "Try on" + , description = "Single list with info.targetElement." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TryOn.elm" + , initialModel = TryOn Gallery.TryOn.initialModel + } + , { segment = "taskboard" + , title = "Task board" + , description = "Two systems - one for the cards and one for the columns." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TaskBoard.elm" + , initialModel = TaskBoard Gallery.TaskBoard.initialModel + } + ] + + +type Tag + = HanoiTag + | PuzzleTag + | ShapesTag + | KnightTag + | TryOnTag + | TaskBoardTag + + +allTags : List Tag +allTags = + let + ignored : Tag -> () + ignored tag = + case tag of + HanoiTag -> + () + + PuzzleTag -> + () + + ShapesTag -> + () + + KnightTag -> + () + + TryOnTag -> + () + + TaskBoardTag -> + () + in + [ HanoiTag + , PuzzleTag + , ShapesTag + , KnightTag + , TryOnTag + , TaskBoardTag + ] + + +exampleToTag : Example -> Tag +exampleToTag example = + case example of + Hanoi _ -> + HanoiTag + + Puzzle _ -> + PuzzleTag + + Shapes _ -> + ShapesTag + + Knight _ -> + KnightTag + + TryOn _ -> + TryOnTag + + TaskBoard _ -> + TaskBoardTag + + +tagSegmentDict : AssocList.Dict Tag (Views.Metadata Example) +tagSegmentDict = + List.map2 Tuple.pair allTags meta |> AssocList.fromList + + +tagToMetadata : Tag -> Views.Metadata Example +tagToMetadata tag = + Maybe.withDefault defaultMeta <| + case tag of + HanoiTag -> + AssocList.get HanoiTag tagSegmentDict + + PuzzleTag -> + AssocList.get PuzzleTag tagSegmentDict + + ShapesTag -> + AssocList.get ShapesTag tagSegmentDict + + KnightTag -> + AssocList.get KnightTag tagSegmentDict + + TryOnTag -> + AssocList.get TryOnTag tagSegmentDict + + TaskBoardTag -> + AssocList.get TaskBoardTag tagSegmentDict + + + +-- MODEL + + +type Example + = Hanoi Gallery.Hanoi.Model + | Puzzle Gallery.Puzzle.Model + | Shapes Gallery.Shapes.Model + | Knight Gallery.Knight.Model + | TryOn Gallery.TryOn.Model + | TaskBoard Gallery.TaskBoard.Model + + +init : String -> ( Example, Cmd Msg ) +init segment = + ( meta + |> List.map (\m -> ( m.segment, m.initialModel )) + |> Dict.fromList + |> Dict.get segment + |> Maybe.withDefault defaultMeta.initialModel + , commands + ) + + + +-- UPDATE + + +type Msg + = HanoiMsg Gallery.Hanoi.Msg + | PuzzleMsg Gallery.Puzzle.Msg + | ShapesMsg Gallery.Shapes.Msg + | KnightMsg Gallery.Knight.Msg + | TryOnMsg Gallery.TryOn.Msg + | TaskBoardMsg Gallery.TaskBoard.Msg + + +commands : Cmd Msg +commands = + Cmd.map PuzzleMsg Gallery.Puzzle.commands + + +subscriptions : Example -> Sub Msg +subscriptions example = + case example of + Hanoi subModel -> + Sub.map HanoiMsg (Gallery.Hanoi.subscriptions subModel) + + Puzzle subModel -> + Sub.map PuzzleMsg (Gallery.Puzzle.subscriptions subModel) + + Shapes subModel -> + Sub.map ShapesMsg (Gallery.Shapes.subscriptions subModel) + + Knight subModel -> + Sub.map KnightMsg (Gallery.Knight.subscriptions subModel) + + TryOn subModel -> + Sub.map TryOnMsg (Gallery.TryOn.subscriptions subModel) + + TaskBoard subModel -> + Sub.map TaskBoardMsg (Gallery.TaskBoard.subscriptions subModel) + + +update : Msg -> Example -> ( Example, Cmd Msg ) +update msg example = + case ( msg, example ) of + ( HanoiMsg subMsg, Hanoi subModel ) -> + stepHanoi (Gallery.Hanoi.update subMsg subModel) + + ( PuzzleMsg subMsg, Puzzle subModel ) -> + stepPuzzle (Gallery.Puzzle.update subMsg subModel) + + ( ShapesMsg subMsg, Shapes subModel ) -> + stepShapes (Gallery.Shapes.update subMsg subModel) + + ( KnightMsg subMsg, Knight subModel ) -> + stepKnight (Gallery.Knight.update subMsg subModel) + + ( TryOnMsg subMsg, TryOn subModel ) -> + stepTryOn (Gallery.TryOn.update subMsg subModel) + + ( TaskBoardMsg subMsg, TaskBoard subModel ) -> + stepTaskBoard (Gallery.TaskBoard.update subMsg subModel) + + _ -> + ( example, Cmd.none ) + + +stepHanoi : ( Gallery.Hanoi.Model, Cmd Gallery.Hanoi.Msg ) -> ( Example, Cmd Msg ) +stepHanoi ( subModel, subCmd ) = + ( Hanoi subModel, Cmd.map HanoiMsg subCmd ) + + +stepPuzzle : ( Gallery.Puzzle.Model, Cmd Gallery.Puzzle.Msg ) -> ( Example, Cmd Msg ) +stepPuzzle ( subModel, subCmd ) = + ( Puzzle subModel, Cmd.map PuzzleMsg subCmd ) + + +stepShapes : ( Gallery.Shapes.Model, Cmd Gallery.Shapes.Msg ) -> ( Example, Cmd Msg ) +stepShapes ( subModel, subCmd ) = + ( Shapes subModel, Cmd.map ShapesMsg subCmd ) + + +stepKnight : ( Gallery.Knight.Model, Cmd Gallery.Knight.Msg ) -> ( Example, Cmd Msg ) +stepKnight ( subModel, subCmd ) = + ( Knight subModel, Cmd.map KnightMsg subCmd ) + + +stepTryOn : ( Gallery.TryOn.Model, Cmd Gallery.TryOn.Msg ) -> ( Example, Cmd Msg ) +stepTryOn ( subModel, subCmd ) = + ( TryOn subModel, Cmd.map TryOnMsg subCmd ) + + +stepTaskBoard : ( Gallery.TaskBoard.Model, Cmd Gallery.TaskBoard.Msg ) -> ( Example, Cmd Msg ) +stepTaskBoard ( subModel, subCmd ) = + ( TaskBoard subModel, Cmd.map TaskBoardMsg subCmd ) + + + +-- VIEW + + +view : Example -> List (Html.Html Msg) +view example = + [ Views.demoHeaderView + (example + |> exampleToTag + |> tagToMetadata + |> (\m -> { title = m.title, description = m.description, link = m.link }) + ) + , case example of + Hanoi subModel -> + Html.map HanoiMsg (Gallery.Hanoi.view subModel) + + Puzzle subModel -> + Html.map PuzzleMsg (Gallery.Puzzle.view subModel) + + Shapes subModel -> + Html.map ShapesMsg (Gallery.Shapes.view subModel) + + Knight subModel -> + Html.map KnightMsg (Gallery.Knight.view subModel) + + TryOn subModel -> + Html.map TryOnMsg (Gallery.TryOn.view subModel) + + TaskBoard subModel -> + Html.map TaskBoardMsg (Gallery.TaskBoard.view subModel) + , CustomElement.elmCode + [ CustomElement.href (example |> exampleToTag |> tagToMetadata |> (\m -> m.link)) ] + [] + ] + + +chapterView : String -> Html.Html msg +chapterView class = + Views.chapterView + class + { title = "Gallery" + , slug = "gallery" + , allTags = allTags |> List.map (tagToMetadata >> (\m -> { segment = m.segment, title = m.title })) + } diff --git a/examples/src/Gallery/Puzzle.elm b/examples/src/Gallery/Puzzle.elm index d2c3322..fbc7569 100755 --- a/examples/src/Gallery/Puzzle.elm +++ b/examples/src/Gallery/Puzzle.elm @@ -1,6 +1,7 @@ module Gallery.Puzzle exposing (Model, Msg, commands, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -54,36 +55,21 @@ solution = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = \_ _ list -> list - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Swap - , groups = - { listen = DnDList.Groups.OnDrop - , operation = DnDList.Groups.Swap - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Swap + |> DnDList.Groups.groups + { listen = DnDList.OnDrop + , operation = DnDList.Swap + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.create DnDMsg @@ -91,20 +77,20 @@ system = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = [] + { items = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, commands ) @@ -132,12 +118,12 @@ commands = type Msg = NewGame (List Item) - | MyMsg DnDList.Groups.Msg + | DnDMsg DnDList.Groups.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of +update msg model = + case msg of NewGame shuffled -> ( { model | items = @@ -166,13 +152,13 @@ update message model = , Cmd.none ) - MyMsg msg -> + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) diff --git a/examples/src/Gallery/Root.elm b/examples/src/Gallery/Root.elm deleted file mode 100755 index 0074619..0000000 --- a/examples/src/Gallery/Root.elm +++ /dev/null @@ -1,327 +0,0 @@ -module Gallery.Root exposing - ( Model - , Msg - , codeView - , demoView - , headerView - , init - , navigationView - , subscriptions - , update - ) - -import CustomElement -import Gallery.Hanoi -import Gallery.Knight -import Gallery.Puzzle -import Gallery.Shapes -import Gallery.TaskBoard -import Gallery.TryOn -import Html -import Html.Attributes -import Path -import Url.Builder - - - --- MODEL - - -type alias Model = - Example - - -type Example - = Hanoi Gallery.Hanoi.Model - | Puzzle Gallery.Puzzle.Model - | Shapes Gallery.Shapes.Model - | Knight Gallery.Knight.Model - | TryOn Gallery.TryOn.Model - | TaskBoard Gallery.TaskBoard.Model - - -init : String -> ( Model, Cmd Msg ) -init slug = - ( toExample slug, commands ) - - - --- UPDATE - - -type Msg - = HanoiMsg Gallery.Hanoi.Msg - | PuzzleMsg Gallery.Puzzle.Msg - | ShapesMsg Gallery.Shapes.Msg - | KnightMsg Gallery.Knight.Msg - | TryOnMsg Gallery.TryOn.Msg - | TaskBoardMsg Gallery.TaskBoard.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case ( message, model ) of - ( HanoiMsg msg, Hanoi mo ) -> - stepHanoi (Gallery.Hanoi.update msg mo) - - ( PuzzleMsg msg, Puzzle mo ) -> - stepPuzzle (Gallery.Puzzle.update msg mo) - - ( ShapesMsg msg, Shapes mo ) -> - stepShapes (Gallery.Shapes.update msg mo) - - ( KnightMsg msg, Knight mo ) -> - stepKnight (Gallery.Knight.update msg mo) - - ( TryOnMsg msg, TryOn mo ) -> - stepTryOn (Gallery.TryOn.update msg mo) - - ( TaskBoardMsg msg, TaskBoard mo ) -> - stepTaskBoard (Gallery.TaskBoard.update msg mo) - - _ -> - ( model, Cmd.none ) - - -stepHanoi : ( Gallery.Hanoi.Model, Cmd Gallery.Hanoi.Msg ) -> ( Model, Cmd Msg ) -stepHanoi ( mo, cmds ) = - ( Hanoi mo, Cmd.map HanoiMsg cmds ) - - -stepPuzzle : ( Gallery.Puzzle.Model, Cmd Gallery.Puzzle.Msg ) -> ( Model, Cmd Msg ) -stepPuzzle ( mo, cmds ) = - ( Puzzle mo, Cmd.map PuzzleMsg cmds ) - - -stepShapes : ( Gallery.Shapes.Model, Cmd Gallery.Shapes.Msg ) -> ( Model, Cmd Msg ) -stepShapes ( mo, cmds ) = - ( Shapes mo, Cmd.map ShapesMsg cmds ) - - -stepKnight : ( Gallery.Knight.Model, Cmd Gallery.Knight.Msg ) -> ( Model, Cmd Msg ) -stepKnight ( mo, cmds ) = - ( Knight mo, Cmd.map KnightMsg cmds ) - - -stepTryOn : ( Gallery.TryOn.Model, Cmd Gallery.TryOn.Msg ) -> ( Model, Cmd Msg ) -stepTryOn ( mo, cmds ) = - ( TryOn mo, Cmd.map TryOnMsg cmds ) - - -stepTaskBoard : ( Gallery.TaskBoard.Model, Cmd Gallery.TaskBoard.Msg ) -> ( Model, Cmd Msg ) -stepTaskBoard ( mo, cmds ) = - ( TaskBoard mo, Cmd.map TaskBoardMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - case model of - Hanoi mo -> - Sub.map HanoiMsg (Gallery.Hanoi.subscriptions mo) - - Puzzle mo -> - Sub.map PuzzleMsg (Gallery.Puzzle.subscriptions mo) - - Shapes mo -> - Sub.map ShapesMsg (Gallery.Shapes.subscriptions mo) - - Knight mo -> - Sub.map KnightMsg (Gallery.Knight.subscriptions mo) - - TryOn mo -> - Sub.map TryOnMsg (Gallery.TryOn.subscriptions mo) - - TaskBoard mo -> - Sub.map TaskBoardMsg (Gallery.TaskBoard.subscriptions mo) - - - --- COMMANDS - - -commands : Cmd Msg -commands = - Cmd.map PuzzleMsg Gallery.Puzzle.commands - - - --- VIEW - - -navigationView : String -> Html.Html Msg -navigationView currentPath = - Html.div - [ Html.Attributes.class "navigation" ] - [ Html.h4 [] [ Html.text "Gallery" ] - , [ Hanoi Gallery.Hanoi.initialModel - , Puzzle Gallery.Puzzle.initialModel - , Shapes Gallery.Shapes.initialModel - , Knight Gallery.Knight.initialModel - , TryOn Gallery.TryOn.initialModel - , TaskBoard Gallery.TaskBoard.initialModel - ] - |> List.map (linkView currentPath) - |> Html.ul [] - ] - - -linkView : String -> Example -> Html.Html Msg -linkView currentPath example = - let - path : String - path = - Url.Builder.absolute [ Path.rootPath, "gallery", (info >> .slug) example ] [] - in - Html.li [] - [ Html.a - [ Html.Attributes.classList [ ( "is-active", path == currentPath ) ] - , Html.Attributes.href path - ] - [ Html.text ((info >> .title) example) ] - ] - - -headerView : Model -> Html.Html Msg -headerView model = - let - title : String - title = - (info >> .title) model - - description : String - description = - (info >> .description) model - in - Html.header [] - [ Html.h2 [] [ Html.text title ] - , Html.p [] [ Html.text description ] - ] - - -demoView : Model -> Html.Html Msg -demoView model = - case model of - Hanoi mo -> - Html.map HanoiMsg (Gallery.Hanoi.view mo) - - Puzzle mo -> - Html.map PuzzleMsg (Gallery.Puzzle.view mo) - - Shapes mo -> - Html.map ShapesMsg (Gallery.Shapes.view mo) - - Knight mo -> - Html.map KnightMsg (Gallery.Knight.view mo) - - TryOn mo -> - Html.map TryOnMsg (Gallery.TryOn.view mo) - - TaskBoard mo -> - Html.map TaskBoardMsg (Gallery.TaskBoard.view mo) - - -codeView : Model -> Html.Html Msg -codeView model = - case model of - Hanoi _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Hanoi.elm" - - Puzzle _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Puzzle.elm" - - Shapes _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Shapes.elm" - - Knight _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/Knight.elm" - - TryOn _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TryOn.elm" - - TaskBoard _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Gallery/TaskBoard.elm" - - -toCode : String -> Html.Html msg -toCode url = - CustomElement.elmCode [ CustomElement.href url ] [] - - - --- EXAMPLE INFO - - -toExample : String -> Example -toExample slug = - case slug of - "hanoi" -> - Hanoi Gallery.Hanoi.initialModel - - "puzzle" -> - Puzzle Gallery.Puzzle.initialModel - - "shapes" -> - Shapes Gallery.Shapes.initialModel - - "knight" -> - Knight Gallery.Knight.initialModel - - "try-on" -> - TryOn Gallery.TryOn.initialModel - - "taskboard" -> - TaskBoard Gallery.TaskBoard.initialModel - - _ -> - Hanoi Gallery.Hanoi.initialModel - - -type alias Info = - { slug : String - , title : String - , description : String - } - - -info : Example -> Info -info example = - case example of - Hanoi _ -> - { slug = "hanoi" - , title = "Towers of Hanoi" - , description = "Flat list with auxiliary items." - } - - Puzzle _ -> - { slug = "puzzle" - , title = "Puzzle" - , description = "List with groups without auxiliary items." - } - - Shapes _ -> - { slug = "shapes" - , title = "Geometric shapes" - , description = "Flat list with the Unaltered operation and beforeUpdate." - } - - Knight _ -> - { slug = "knight" - , title = "Knight's tour" - , description = "Flat list with Swap. The top-left 5 × 5 sub-board is diced from the original 8 × 8 board." - } - - TryOn _ -> - { slug = "try-on" - , title = "Try on" - , description = "Flat list with info.targetElement." - } - - TaskBoard _ -> - { slug = "taskboard" - , title = "Task board" - , description = "Two systems - one for the cards and one for the columns." - } diff --git a/examples/src/Gallery/Shapes.elm b/examples/src/Gallery/Shapes.elm index daaa97c..672a02f 100755 --- a/examples/src/Gallery/Shapes.elm +++ b/examples/src/Gallery/Shapes.elm @@ -2,6 +2,7 @@ module Gallery.Shapes exposing (Model, Msg, initialModel, main, subscriptions, u import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Svg @@ -60,21 +61,16 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = updateShapes - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Unaltered - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Unaltered + |> DnDList.Single.setItemsBeforeReorder updateShapes + |> DnDList.Single.create DnDMsg updateShapes : Int -> Int -> List Item -> List Item @@ -128,20 +124,20 @@ updateShapes dragIndex dropIndex list = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -159,19 +155,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -209,7 +205,7 @@ scoreView items = [ Html.text ("Attempts: " ++ attempts) ] -shapeView : DnDList.Model -> Int -> Item -> Html.Html Msg +shapeView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg shapeView dnd index { shape, color, solved } = let itemId : String @@ -240,7 +236,7 @@ shapeView dnd index { shape, color, solved } = [ svgView shape color (Html.Attributes.id itemId :: system.dragEvents index itemId) ] -holeView : DnDList.Model -> Int -> Item -> Html.Html Msg +holeView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg holeView dnd index { shape, color } = let globalIndex : Int @@ -263,7 +259,7 @@ holeView dnd index { shape, color } = [ svgView shape color [ Html.Attributes.id itemId ] ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item diff --git a/examples/src/Gallery/TaskBoard.elm b/examples/src/Gallery/TaskBoard.elm index aa8778c..b171ee2 100755 --- a/examples/src/Gallery/TaskBoard.elm +++ b/examples/src/Gallery/TaskBoard.elm @@ -3,6 +3,7 @@ module Gallery.TaskBoard exposing (Model, Msg, initialModel, main, subscriptions import Browser import DnDList import DnDList.Groups +import DnDList.Single import Html import Html.Attributes @@ -53,50 +54,26 @@ data = --- SYSTEM - - -cardConfig : DnDList.Groups.Config Card -cardConfig = - { beforeUpdate = \_ _ list -> list - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Rotate - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.InsertBefore - , comparator = comparator - , setter = setter - } - } - - -comparator : Card -> Card -> Bool -comparator card1 card2 = - card1.activity == card2.activity - - -setter : Card -> Card -> Card -setter card1 card2 = - { card2 | activity = card1.activity } +-- DND cardSystem : DnDList.Groups.System Card Msg cardSystem = - DnDList.Groups.create cardConfig CardMoved - - -columnConfig : DnDList.Config (List Card) -columnConfig = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Rotate - } - - -columnSystem : DnDList.System (List Card) Msg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Rotate + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.InsertBefore + , comparator = \card1 card2 -> card1.activity == card2.activity + , setter = \card1 card2 -> { card2 | activity = card1.activity } + } + |> DnDList.Groups.create CardMoved + + +columnSystem : DnDList.Single.System (List Card) Msg columnSystem = - DnDList.create columnConfig ColumnMoved + DnDList.Single.create ColumnMoved DnDList.Single.config @@ -104,22 +81,22 @@ columnSystem = type alias Model = - { cardDnD : DnDList.Groups.Model - , columnDnD : DnDList.Model - , cards : List Card + { cards : List Card + , cardDnD : DnDList.Groups.Model + , columnDnD : DnDList.Single.Model } initialModel : Model initialModel = - { cardDnD = cardSystem.model + { cards = data + , cardDnD = cardSystem.model , columnDnD = columnSystem.model - , cards = data } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -141,34 +118,34 @@ subscriptions model = type Msg = CardMoved DnDList.Groups.Msg - | ColumnMoved DnDList.Msg + | ColumnMoved DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - CardMoved msg -> +update msg model = + case msg of + CardMoved cardMovedMsg -> let - ( cardDnD, cards ) = - cardSystem.update msg model.cardDnD model.cards + ( cards, cardDnDModel, cardCmd ) = + cardSystem.update model.cards cardMovedMsg model.cardDnD in ( { model - | cardDnD = cardDnD - , cards = cards + | cards = cards + , cardDnD = cardDnDModel } - , cardSystem.commands cardDnD + , cardCmd ) - ColumnMoved msg -> + ColumnMoved columnMovedMsg -> let - ( columnDnD, columns ) = - columnSystem.update msg model.columnDnD (gatherByActivity model.cards) + ( columns, columnDnDModel, columnCmd ) = + columnSystem.update (gatherByActivity model.cards) columnMovedMsg model.columnDnD in ( { model - | columnDnD = columnDnD - , cards = List.concat columns + | cards = List.concat columns + , columnDnD = columnDnDModel } - , columnSystem.commands columnDnD + , columnCmd ) diff --git a/examples/src/Gallery/TryOn.elm b/examples/src/Gallery/TryOn.elm index 3f68e87..471bc18 100755 --- a/examples/src/Gallery/TryOn.elm +++ b/examples/src/Gallery/TryOn.elm @@ -2,6 +2,7 @@ module Gallery.TryOn exposing (Model, Msg, initialModel, main, subscriptions, up import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Svg @@ -54,21 +55,17 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = updateColor - , movement = DnDList.Free - , listen = DnDList.OnDrop - , operation = DnDList.Unaltered - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.listen DnDList.OnDrop + |> DnDList.Single.operation DnDList.Unaltered + |> DnDList.Single.ghost [ "positionTopLeft" ] + |> DnDList.Single.setItemsBeforeReorder updateColor + |> DnDList.Single.create DnDMsg updateColor : Int -> Int -> List Item -> List Item @@ -106,20 +103,20 @@ updateColor dragIndex dropIndex list = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -137,19 +134,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -267,8 +264,8 @@ ghostView model = height color (system.ghostStyles model.dnd - ++ [ Html.Attributes.style "width" (String.fromInt width ++ "rem") - , Html.Attributes.style "height" (String.fromInt height ++ "rem") + ++ [ Html.Attributes.style "width" (String.fromInt width ++ "em") + , Html.Attributes.style "height" (String.fromInt height ++ "em") , Html.Attributes.style "transition" "width 0.5s, height 0.5s" ] ) @@ -314,6 +311,7 @@ sectionStyles = , Html.Attributes.style "align-items" "center" , Html.Attributes.style "justify-content" "center" , Html.Attributes.style "padding-top" "2rem" + , Html.Attributes.style "font-size" "14px" ] @@ -341,8 +339,8 @@ colorStyles width height color = [ Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "margin" "0 3rem 3rem 0" , Html.Attributes.style "background-color" color - , Html.Attributes.style "width" (String.fromInt width ++ "rem") - , Html.Attributes.style "height" (String.fromInt height ++ "rem") + , Html.Attributes.style "width" (String.fromInt width ++ "em") + , Html.Attributes.style "height" (String.fromInt height ++ "em") ] diff --git a/examples/src/Global.elm b/examples/src/Global.elm new file mode 100644 index 0000000..11fa030 --- /dev/null +++ b/examples/src/Global.elm @@ -0,0 +1,21 @@ +module Global exposing (Model, Msg(..), initialModel, update) + + +type alias Model = + { showMenu : Bool } + + +initialModel : Model +initialModel = + { showMenu = True } + + +type Msg + = ShowMenu + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + ShowMenu -> + ( { model | showMenu = not model.showMenu }, Cmd.none ) diff --git a/examples/src/Home.elm b/examples/src/Home.elm old mode 100755 new mode 100644 index d5fa291..b0232a5 --- a/examples/src/Home.elm +++ b/examples/src/Home.elm @@ -1,69 +1,14 @@ -module Home exposing (Model, Msg, init, initialModel, main, subscriptions, update, view) +module Home exposing (view) -import Browser +import DnDList.Groups.Parent +import DnDList.Single.Parent import Html +import Views - --- MAIN - - -main : Program () Model Msg -main = - Browser.element - { init = init - , view = view - , update = update - , subscriptions = subscriptions - } - - - --- MODEL - - -type alias Model = - Int - - -initialModel : Model -initialModel = - 4 - - -init : () -> ( Model, Cmd Msg ) -init _ = - ( initialModel, Cmd.none ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - Sub.none - - - --- UPDATE - - -type Msg - = NoOp - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - NoOp -> - ( model, Cmd.none ) - - - --- VIEW - - -view : Model -> Html.Html Msg -view model = - Html.text "" +view : Html.Html msg +view = + Views.homeView + [ DnDList.Single.Parent.chapterView "home" + , DnDList.Groups.Parent.chapterView "home" + ] diff --git a/examples/src/Icons.elm b/examples/src/Icons.elm new file mode 100644 index 0000000..7328ac3 --- /dev/null +++ b/examples/src/Icons.elm @@ -0,0 +1,51 @@ +module Icons exposing (elmLogo, externalLink, githubLogo, hamburger) + +import Html +import Svg +import Svg.Attributes + + +externalLink : Html.Html msg +externalLink = + Svg.svg + [ Svg.Attributes.viewBox "0 0 512 512" + , Svg.Attributes.fill "currentColor" + ] + [ Svg.path [ Svg.Attributes.d "m 432,320 h -32 a 16,16 0 0 0 -16,16 V 448 H 64 V 128 h 144 a 16,16 0 0 0 16,-16 V 80 A 16,16 0 0 0 208,64 H 48 A 48,48 0 0 0 0,112 v 352 a 48,48 0 0 0 48,48 h 352 a 48,48 0 0 0 48,-48 V 336 A 16,16 0 0 0 432,320 Z M 488,0 H 360 C 338.63,0 327.95,25.91 343,41 L 378.73,76.73 135,320.37 a 24,24 0 0 0 0,34 L 157.67,377 a 24,24 0 0 0 34,0 L 435.28,133.32 471,169 c 15,15 41,4.5 41,-17 V 24 A 24,24 0 0 0 488,0 Z" ] [] ] + + +hamburger : Html.Html msg +hamburger = + Svg.svg + [ Svg.Attributes.viewBox "0 0 448 392" + , Svg.Attributes.fill "currentColor" + ] + [ Svg.path [ Svg.Attributes.d "m 16,72 h 416 c 8.837,0 16,-7.163 16,-16 V 16 C 448,7.163 440.837,0 432,0 H 16 C 7.163,0 0,7.163 0,16 v 40 c 0,8.837 7.163,16 16,16 z m 0,160 h 416 c 8.837,0 16,-7.163 16,-16 v -40 c 0,-8.837 -7.163,-16 -16,-16 H 16 c -8.837,0 -16,7.163 -16,16 v 40 c 0,8.837 7.163,16 16,16 z m 0,160 h 416 c 8.837,0 16,-7.163 16,-16 v -40 c 0,-8.837 -7.163,-16 -16,-16 H 16 c -8.837,0 -16,7.163 -16,16 v 40 c 0,8.837 7.163,16 16,16 z" ] [] ] + + +githubLogo : Html.Html msg +githubLogo = + Svg.svg + [ Svg.Attributes.viewBox "0 0 496.26459 483.87128" + , Svg.Attributes.fill "currentColor" + ] + [ Svg.path [ Svg.Attributes.d "m 166.42917,389.99162 c 0,2 -2.3,3.6 -5.2,3.6 -3.3,0.3 -5.6,-1.3 -5.6,-3.6 0,-2 2.3,-3.6 5.2,-3.6 3,-0.3 5.6,1.3 5.6,3.6 z m -31.1,-4.5 c -0.7,2 1.3,4.3 4.3,4.9 2.6,1 5.6,0 6.2,-2 0.6,-2 -1.3,-4.3 -4.3,-5.2 -2.6,-0.7 -5.5,0.3 -6.2,2.3 z m 44.2,-1.7 c -2.9,0.7 -4.9,2.6 -4.6,4.9 0.3,2 2.9,3.3 5.9,2.6 2.9,-0.7 4.9,-2.6 4.6,-4.6 -0.3,-1.9 -3,-3.2 -5.9,-2.9 z m 65.8,-383.19995377 c -138.7,0 -244.80000337,105.29995377 -244.80000337,243.99995377 0,110.9 69.80000037,205.8 169.50000337,239.2 12.8,2.3 17.3,-5.6 17.3,-12.1 0,-6.2 -0.3,-40.4 -0.3,-61.4 0,0 -70,15 -84.7,-29.8 0,0 -11.400003,-29.1 -27.800003,-36.6 0,0 -22.9,-15.7 1.6,-15.4 0,0 24.900003,2 38.600003,25.8 21.9,38.6 58.6,27.5 72.9,20.9 2.3,-16 8.8,-27.1 16,-33.7 -55.9,-6.2 -112.300003,-14.3 -112.300003,-110.5 0,-27.5 7.6,-41.3 23.600003,-58.9 -2.6,-6.5 -11.1,-33.3 2.6,-67.9 20.9,-6.499985 69,27 69,27 20,-5.6 41.5,-8.5 62.8,-8.5 21.3,0 42.8,2.9 62.8,8.5 0,0 48.1,-33.599985 69,-27 13.7,34.7 5.2,61.4 2.6,67.9 16,17.7 25.8,31.5 25.8,58.9 0,96.5 -58.9,104.2 -114.8,110.5 9.2,7.9 17,22.9 17,46.4 0,33.7 -0.3,75.4 -0.3,83.6 0,6.5 4.6,14.4 17.3,12.1 100,-33.2 167.8,-128.1 167.8,-239 0,-138.7 -112.5,-243.99995377 -251.2,-243.99995377 z M 97.729167,345.49162 c -1.3,1 -1,3.3 0.7,5.2 1.600003,1.6 3.900003,2.3 5.200003,1 1.3,-1 1,-3.3 -0.7,-5.2 -1.6,-1.6 -3.900003,-2.3 -5.200003,-1 z m -10.8,-8.1 c -0.7,1.3 0.3,2.9 2.3,3.9 1.6,1 3.6,0.7 4.3,-0.7 0.7,-1.3 -0.3,-2.9 -2.3,-3.9 -2,-0.6 -3.6,-0.3 -4.3,0.7 z m 32.400003,35.6 c -1.6,1.3 -1,4.3 1.3,6.2 2.3,2.3 5.2,2.6 6.5,1 1.3,-1.3 0.7,-4.3 -1.3,-6.2 -2.2,-2.3 -5.2,-2.6 -6.5,-1 z m -11.4,-14.7 c -1.6,1 -1.6,3.6 0,5.9 1.6,2.3 4.3,3.3 5.6,2.3 1.6,-1.3 1.6,-3.9 0,-6.2 -1.4,-2.3 -4,-3.3 -5.6,-2 z" ] [] ] + + +elmLogo : Html.Html msg +elmLogo = + Svg.svg + [ Svg.Attributes.viewBox "0 0 600 600" ] + [ shape "0,20 280,300 0,580" + , shape "20,600 300,320 580,600" + , shape "320,0 600,0 600,280" + , shape "20,0 280,0 402,122 142,122" + , shape "170,150 430,150 300,280" + , shape "320,300 450,170 580,300 450,430" + , shape "470,450 600,320 600,580" + ] + + +shape : String -> Svg.Svg msg +shape coordinates = + Svg.polygon [ Svg.Attributes.fill "currentColor", Svg.Attributes.points coordinates ] [] diff --git a/examples/src/Introduction/Basic.elm b/examples/src/Introduction/Basic.elm index d167472..3b088aa 100755 --- a/examples/src/Introduction/Basic.elm +++ b/examples/src/Introduction/Basic.elm @@ -1,26 +1,12 @@ module Introduction.Basic exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser -import DnDList +import DnDList.Single import Html import Html.Attributes --- MAIN - - -main : Program () Model Msg -main = - Browser.element - { init = init - , view = view - , update = update - , subscriptions = subscriptions - } - - - -- DATA @@ -34,21 +20,35 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Fruit -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Rotate - } +system : DnDList.Single.System Fruit Msg +system = + DnDList.Single.create DnDMsg DnDList.Single.config -system : DnDList.System Fruit Msg -system = - DnDList.create config MyMsg + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd @@ -56,50 +56,41 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Fruit + { items : List Fruit + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - system.subscriptions model.dnd - - - -- UPDATE type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -110,7 +101,7 @@ update message model = view : Model -> Html.Html Msg view model = Html.section - [ Html.Attributes.style "text-align" "center" ] + [] [ model.items |> List.indexedMap (itemView model.dnd) |> Html.div [] @@ -118,7 +109,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Fruit -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Fruit -> Html.Html Msg itemView dnd index item = let itemId : String @@ -143,7 +134,7 @@ itemView dnd index item = [ Html.text item ] -ghostView : DnDList.Model -> List Fruit -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Fruit -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Fruit diff --git a/examples/src/Introduction/BasicElmUI.elm b/examples/src/Introduction/BasicElmUI.elm index 1496ba2..9459fad 100755 --- a/examples/src/Introduction/BasicElmUI.elm +++ b/examples/src/Introduction/BasicElmUI.elm @@ -1,9 +1,8 @@ module Introduction.BasicElmUI exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser -import DnDList +import DnDList.Single import Element -import Element.Font import Html import Html.Attributes @@ -36,21 +35,12 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Fruit -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Rotate - } - - -system : DnDList.System Fruit Msg +system : DnDList.Single.System Fruit Msg system = - DnDList.create config MyMsg + DnDList.Single.create DnDMsg DnDList.Single.config @@ -58,20 +48,20 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Fruit + { items : List Fruit + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -89,19 +79,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -124,7 +114,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Fruit -> Element.Element Msg +itemView : DnDList.Single.Model -> Int -> Fruit -> Element.Element Msg itemView dnd index item = let itemId : String @@ -135,29 +125,26 @@ itemView dnd index item = Just { dragIndex } -> if dragIndex /= index then Element.el - (Element.Font.color (Element.rgb 1 1 1) - :: Element.htmlAttribute (Html.Attributes.id itemId) + (Element.htmlAttribute (Html.Attributes.id itemId) :: List.map Element.htmlAttribute (system.dropEvents index itemId) ) (Element.text item) else Element.el - [ Element.Font.color (Element.rgb 1 1 1) - , Element.htmlAttribute (Html.Attributes.id itemId) + [ Element.htmlAttribute (Html.Attributes.id itemId) ] (Element.text "[---------]") Nothing -> Element.el - (Element.Font.color (Element.rgb 1 1 1) - :: Element.htmlAttribute (Html.Attributes.id itemId) + (Element.htmlAttribute (Html.Attributes.id itemId) :: List.map Element.htmlAttribute (system.dragEvents index itemId) ) (Element.text item) -ghostView : DnDList.Model -> List Fruit -> Element.Element Msg +ghostView : DnDList.Single.Model -> List Fruit -> Element.Element Msg ghostView dnd items = let maybeDragItem : Maybe Fruit @@ -168,9 +155,7 @@ ghostView dnd items = case maybeDragItem of Just item -> Element.el - (Element.Font.color (Element.rgb 1 1 1) - :: List.map Element.htmlAttribute (system.ghostStyles dnd) - ) + (List.map Element.htmlAttribute (system.ghostStyles dnd)) (Element.text item) Nothing -> diff --git a/examples/src/Introduction/Groups.elm b/examples/src/Introduction/Groups.elm index 60e40b5..c425824 100755 --- a/examples/src/Introduction/Groups.elm +++ b/examples/src/Introduction/Groups.elm @@ -1,6 +1,7 @@ module Introduction.Groups exposing (Model, Msg, initialModel, main, subscriptions, update, view) import Browser +import DnDList import DnDList.Groups import Html import Html.Attributes @@ -50,36 +51,21 @@ preparedData = --- SYSTEM - - -config : DnDList.Groups.Config Item -config = - { beforeUpdate = \_ _ list -> list - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Rotate - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.InsertBefore - , comparator = comparator - , setter = setter - } - } - - -comparator : Item -> Item -> Bool -comparator item1 item2 = - item1.group == item2.group - - -setter : Item -> Item -> Item -setter item1 item2 = - { item2 | group = item1.group } +-- DND system : DnDList.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Rotate + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.InsertBefore + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.create DnDMsg @@ -87,20 +73,20 @@ system = type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item + { items : List Item + , dnd : DnDList.Groups.Model } initialModel : Model initialModel = - { dnd = system.model - , items = preparedData + { items = preparedData + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -118,19 +104,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Groups.Msg + = DnDMsg DnDList.Groups.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -141,8 +127,8 @@ update message model = view : Model -> Html.Html Msg view model = Html.section sectionStyles - [ groupView model Left lightRed - , groupView model Right lightBlue + [ groupView model Left red + , groupView model Right blue , ghostView model.dnd model.items ] @@ -257,27 +243,17 @@ maybeDragItem dnd items = red : String red = - "#c30005" + "#3f6593" blue : String blue = - "#0067c3" - - -lightRed : String -lightRed = - "#ea9088" - - -lightBlue : String -lightBlue = - "#88b0ea" + "#8ca9cd" gray : String gray = - "dimgray" + "gainsboro" transparent : String @@ -304,9 +280,10 @@ groupStyles : String -> List (Html.Attribute msg) groupStyles color = [ Html.Attributes.style "display" "flex" , Html.Attributes.style "flex-direction" "column" - , Html.Attributes.style "background-color" color + , Html.Attributes.style "border" ("3px solid " ++ color) , Html.Attributes.style "padding-top" "2rem" , Html.Attributes.style "min-height" "19rem" + , Html.Attributes.style "margin" "2rem" ] @@ -315,8 +292,8 @@ itemStyles color = [ Html.Attributes.style "width" "5rem" , Html.Attributes.style "height" "5rem" , Html.Attributes.style "background-color" color - , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "color" "#ffffff" + , Html.Attributes.style "border-radius" "8px" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "margin" "0 auto 1rem auto" , Html.Attributes.style "display" "flex" diff --git a/examples/src/Introduction/Handle.elm b/examples/src/Introduction/Handle.elm index da1e85d..44edb61 100755 --- a/examples/src/Introduction/Handle.elm +++ b/examples/src/Introduction/Handle.elm @@ -2,6 +2,7 @@ module Introduction.Handle exposing (Model, Msg, initialModel, main, subscriptio import Browser import DnDList +import DnDList.Single import Html import Html.Attributes @@ -34,21 +35,14 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Fruit -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Fruit Msg +system : DnDList.Single.System Fruit Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -56,20 +50,20 @@ system = type alias Model = - { dnd : DnDList.Model - , fruits : List Fruit + { fruits : List Fruit + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , fruits = data + { fruits = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -87,19 +81,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, fruits ) = - system.update msg model.dnd model.fruits + ( fruits, dndModel, dndCmd ) = + system.update model.fruits dndMsg model.dnd in - ( { model | dnd = dnd, fruits = fruits } - , system.commands dnd + ( { model | fruits = fruits, dnd = dndModel } + , dndCmd ) @@ -117,7 +111,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Fruit -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Fruit -> Html.Html Msg itemView dnd index fruit = let fruitId : String @@ -135,7 +129,7 @@ itemView dnd index fruit = else Html.div - (Html.Attributes.id fruitId :: itemStyles "dimgray") + (Html.Attributes.id fruitId :: itemStyles "gainsboro") [] Nothing -> @@ -146,7 +140,7 @@ itemView dnd index fruit = ] -ghostView : DnDList.Model -> List Fruit -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Fruit -> Html.Html Msg ghostView dnd fruits = let maybeDragFruit : Maybe Fruit @@ -157,7 +151,7 @@ ghostView dnd fruits = case maybeDragFruit of Just fruit -> Html.div - (itemStyles orange ++ system.ghostStyles dnd) + (ghostStyles "#d8dee9" ++ system.ghostStyles dnd) [ Html.div (handleStyles darkOrange) [] , Html.text fruit ] @@ -172,22 +166,22 @@ ghostView dnd fruits = green : String green = - "#cddc39" + "#8ca9cd" orange : String orange = - "#dc9a39" + "#3f6593" darkGreen : String darkGreen = - "#afb42b" + "#88c0d0" darkOrange : String darkOrange = - "#b4752b" + "#8ca9cd" @@ -200,29 +194,42 @@ containerStyles = , Html.Attributes.style "flex-wrap" "wrap" , Html.Attributes.style "align-items" "center" , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "padding-top" "4em" + , Html.Attributes.style "padding-top" "2rem" ] itemStyles : String -> List (Html.Attribute msg) itemStyles color = - [ Html.Attributes.style "width" "180px" - , Html.Attributes.style "height" "100px" - , Html.Attributes.style "background-color" color + [ Html.Attributes.style "width" "10rem" + , Html.Attributes.style "height" "5rem" + , Html.Attributes.style "border" ("1px solid " ++ color) + , Html.Attributes.style "box-shadow" "0 25px 50px -12px #d8dee9" , Html.Attributes.style "border-radius" "8px" - , Html.Attributes.style "color" "#000" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" - , Html.Attributes.style "margin" "0 4em 4em 0" + , Html.Attributes.style "margin" "0 4rem 4rem 0" ] handleStyles : String -> List (Html.Attribute msg) handleStyles color = - [ Html.Attributes.style "width" "50px" - , Html.Attributes.style "height" "50px" + [ Html.Attributes.style "width" "2.5rem" + , Html.Attributes.style "height" "2.5rem" , Html.Attributes.style "background-color" color , Html.Attributes.style "border-radius" "8px" - , Html.Attributes.style "margin" "20px" + , Html.Attributes.style "margin" "1rem" , Html.Attributes.style "cursor" "pointer" ] + + +ghostStyles : String -> List (Html.Attribute msg) +ghostStyles color = + [ Html.Attributes.style "width" "10rem" + , Html.Attributes.style "height" "5rem" + , Html.Attributes.style "border" ("1px solid " ++ "#8ca9cd") + , Html.Attributes.style "background-color" color + , Html.Attributes.style "border-radius" "8px" + , Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "center" + , Html.Attributes.style "margin" "0 4rem 4rem 0" + ] diff --git a/examples/src/Introduction/Independents.elm b/examples/src/Introduction/Independents.elm index 1eec253..2ba3c04 100755 --- a/examples/src/Introduction/Independents.elm +++ b/examples/src/Introduction/Independents.elm @@ -2,6 +2,7 @@ module Introduction.Independents exposing (Model, Msg, initialModel, main, subsc import Browser import DnDList +import DnDList.Single import Html import Html.Attributes @@ -39,35 +40,21 @@ blueData = --- SYSTEM +-- DND -redConfig : DnDList.Config String -redConfig = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -redSystem : DnDList.System String Msg +redSystem : DnDList.Single.System String Msg redSystem = - DnDList.create redConfig RedMsg - - -blueConfig : DnDList.Config String -blueConfig = - { movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - , beforeUpdate = \_ _ list -> list - } + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create RedMsg -blueSystem : DnDList.System String Msg +blueSystem : DnDList.Single.System String Msg blueSystem = - DnDList.create blueConfig BlueMsg + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create BlueMsg @@ -75,24 +62,24 @@ blueSystem = type alias Model = - { redDnD : DnDList.Model - , blueDnD : DnDList.Model - , reds : List String + { reds : List String , blues : List String + , redDnD : DnDList.Single.Model + , blueDnD : DnDList.Single.Model } initialModel : Model initialModel = - { redDnD = redSystem.model - , blueDnD = blueSystem.model - , reds = redData + { reds = redData , blues = blueData + , redDnD = redSystem.model + , blueDnD = blueSystem.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -113,35 +100,35 @@ subscriptions model = type Msg - = RedMsg DnDList.Msg - | BlueMsg DnDList.Msg + = RedMsg DnDList.Single.Msg + | BlueMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - RedMsg msg -> +update msg model = + case msg of + RedMsg redMsg -> let - ( redDnD, reds ) = - redSystem.update msg model.redDnD model.reds + ( reds, redDnDModel, redCmd ) = + redSystem.update model.reds redMsg model.redDnD in ( { model - | redDnD = redDnD - , reds = reds + | reds = reds + , redDnD = redDnDModel } - , redSystem.commands redDnD + , redCmd ) - BlueMsg msg -> + BlueMsg blueMsg -> let - ( blueDnD, blues ) = - blueSystem.update msg model.blueDnD model.blues + ( blues, blueDnDModel, blueCmd ) = + blueSystem.update model.blues blueMsg model.blueDnD in ( { model - | blueDnD = blueDnD - , blues = blues + | blues = blues + , blueDnD = blueDnDModel } - , blueSystem.commands blueDnD + , blueCmd ) @@ -163,7 +150,7 @@ view model = ] -redView : DnDList.Model -> Int -> String -> Html.Html Msg +redView : DnDList.Single.Model -> Int -> String -> Html.Html Msg redView dnd index item = let itemId : String @@ -196,7 +183,7 @@ redView dnd index item = [ Html.text item ] -blueView : DnDList.Model -> Int -> String -> Html.Html Msg +blueView : DnDList.Single.Model -> Int -> String -> Html.Html Msg blueView dnd index item = let itemId : String @@ -229,7 +216,7 @@ blueView dnd index item = [ Html.text item ] -redGhostView : DnDList.Model -> List String -> Html.Html Msg +redGhostView : DnDList.Single.Model -> List String -> Html.Html Msg redGhostView dnd items = let maybeDragRed : Maybe String @@ -247,7 +234,7 @@ redGhostView dnd items = Html.text "" -blueGhostView : DnDList.Model -> List String -> Html.Html Msg +blueGhostView : DnDList.Single.Model -> List String -> Html.Html Msg blueGhostView dnd items = let maybeDragBlue : Maybe String @@ -258,7 +245,7 @@ blueGhostView dnd items = case maybeDragBlue of Just item -> Html.div - (itemStyles blueGhost ++ blueSystem.ghostStyles dnd) + (itemStyles ghostBlue ++ blueSystem.ghostStyles dnd) [ Html.text item ] Nothing -> @@ -271,27 +258,27 @@ blueGhostView dnd items = red : String red = - "#ff1117" - - -blue : String -blue = - "#118eff" + "#d8dee9" redGhost : String redGhost = - "#c30005" + "#3f6593" + + +blue : String +blue = + "#8ca9cd" -blueGhost : String -blueGhost = - "#0067c3" +ghostBlue : String +ghostBlue = + "#3f6593" gray : String gray = - "dimgray" + "gainsboro" @@ -321,7 +308,6 @@ itemStyles color = , Html.Attributes.style "height" "5rem" , Html.Attributes.style "background-color" color , Html.Attributes.style "border-radius" "8px" - , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "margin" "0 2em 2em 0" , Html.Attributes.style "display" "flex" diff --git a/examples/src/Introduction/Keyed.elm b/examples/src/Introduction/Keyed.elm index d05693a..966937c 100755 --- a/examples/src/Introduction/Keyed.elm +++ b/examples/src/Introduction/Keyed.elm @@ -2,6 +2,7 @@ module Introduction.Keyed exposing (Model, Msg, initialModel, main, subscription import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Html.Keyed @@ -40,21 +41,14 @@ data = --- SYSTEM +-- DND -config : DnDList.Config KeyedItem -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System KeyedItem Msg +system : DnDList.Single.System KeyedItem Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -62,20 +56,20 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List KeyedItem + { items : List KeyedItem + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -93,19 +87,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -123,7 +117,7 @@ view model = ] -itemView : DnDList.Model -> Int -> KeyedItem -> ( String, Html.Html Msg ) +itemView : DnDList.Single.Model -> Int -> KeyedItem -> ( String, Html.Html Msg ) itemView dnd index ( key, item ) = let itemId : String @@ -135,26 +129,26 @@ itemView dnd index ( key, item ) = if dragIndex /= index then ( key , Html.div - (Html.Attributes.id itemId :: itemStyles green ++ system.dropEvents index itemId) + (Html.Attributes.id itemId :: itemStyles blue ++ system.dropEvents index itemId) [ Html.text item ] ) else ( key , Html.div - (Html.Attributes.id itemId :: itemStyles "dimgray") + (Html.Attributes.id itemId :: itemStyles "gainsboro") [] ) Nothing -> ( key , Html.div - (Html.Attributes.id itemId :: itemStyles green ++ system.dragEvents index itemId) + (Html.Attributes.id itemId :: itemStyles blue ++ system.dragEvents index itemId) [ Html.text item ] ) -ghostView : DnDList.Model -> List KeyedItem -> Html.Html Msg +ghostView : DnDList.Single.Model -> List KeyedItem -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe KeyedItem @@ -165,7 +159,7 @@ ghostView dnd items = case maybeDragItem of Just ( _, item ) -> Html.div - (itemStyles ghostGreen ++ system.ghostStyles dnd) + (itemStyles ghostBlue ++ system.ghostStyles dnd) [ Html.text item ] Nothing -> @@ -176,17 +170,18 @@ ghostView dnd items = -- COLORS -green : String -green = - "#3da565" +blue : String +blue = + "#8ca9cd" -ghostGreen : String -ghostGreen = - "#2f804e" +ghostBlue : String +ghostBlue = + "#3f6593" +-- "#5e81ac" -- STYLES @@ -196,7 +191,7 @@ containerStyles = , Html.Attributes.style "flex-wrap" "wrap" , Html.Attributes.style "align-items" "center" , Html.Attributes.style "justify-content" "center" - , Html.Attributes.style "padding-top" "2em" + , Html.Attributes.style "padding-top" "2rem" ] @@ -206,9 +201,8 @@ itemStyles color = , Html.Attributes.style "height" "5rem" , Html.Attributes.style "background-color" color , Html.Attributes.style "border-radius" "8px" - , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" - , Html.Attributes.style "margin" "0 2em 2em 0" + , Html.Attributes.style "margin" "0 2rem 2rem 0" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" , Html.Attributes.style "justify-content" "center" diff --git a/examples/src/Introduction/Margins.elm b/examples/src/Introduction/Margins.elm index 044419c..eeefaa7 100755 --- a/examples/src/Introduction/Margins.elm +++ b/examples/src/Introduction/Margins.elm @@ -2,6 +2,7 @@ module Introduction.Margins exposing (Model, Msg, initialModel, main, subscripti import Browser import DnDList +import DnDList.Single import Html import Html.Attributes @@ -34,21 +35,14 @@ data = --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -56,20 +50,20 @@ system = type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = data + { items = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -87,19 +81,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -117,7 +111,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index item = let itemId : String @@ -130,7 +124,7 @@ itemView dnd index item = Html.div [ Html.Attributes.style "margin" "2em" ] [ Html.div - (Html.Attributes.id itemId :: itemStyles green ++ system.dropEvents index itemId) + (Html.Attributes.id itemId :: itemStyles blue ++ system.dropEvents index itemId) [ Html.text item ] ] @@ -138,7 +132,7 @@ itemView dnd index item = Html.div [ Html.Attributes.style "margin" "2em" ] [ Html.div - (Html.Attributes.id itemId :: itemStyles "dimgray") + (Html.Attributes.id itemId :: itemStyles "gainsboro") [] ] @@ -146,12 +140,12 @@ itemView dnd index item = Html.div [ Html.Attributes.style "margin" "2em" ] [ Html.div - (Html.Attributes.id itemId :: itemStyles green ++ system.dragEvents index itemId) + (Html.Attributes.id itemId :: itemStyles blue ++ system.dragEvents index itemId) [ Html.text item ] ] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -162,7 +156,7 @@ ghostView dnd items = case maybeDragItem of Just item -> Html.div - (itemStyles ghostGreen ++ system.ghostStyles dnd) + (itemStyles ghostBlue ++ system.ghostStyles dnd) [ Html.text item ] Nothing -> @@ -173,14 +167,14 @@ ghostView dnd items = -- COLORS -green : String -green = - "#3da565" +blue : String +blue = + "#8ca9cd" -ghostGreen : String -ghostGreen = - "#2f804e" +ghostBlue : String +ghostBlue = + "#3f6593" @@ -202,7 +196,6 @@ itemStyles color = , Html.Attributes.style "height" "5rem" , Html.Attributes.style "background-color" color , Html.Attributes.style "border-radius" "8px" - , Html.Attributes.style "color" "white" , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "display" "flex" , Html.Attributes.style "align-items" "center" diff --git a/examples/src/Introduction/Masonry.elm b/examples/src/Introduction/Masonry.elm index d546cab..34dca4e 100755 --- a/examples/src/Introduction/Masonry.elm +++ b/examples/src/Introduction/Masonry.elm @@ -2,6 +2,7 @@ module Introduction.Masonry exposing (Model, Msg, commands, initialModel, main, import Browser import DnDList +import DnDList.Single import Html import Html.Attributes import Random @@ -31,34 +32,26 @@ type alias Color = colors : List Color colors = - [ "#acfe2f" - , "#cefe2f" - , "#f0fe2f" - , "#feea2f" - , "#fec72f" - , "#fea52f" - , "#fe832f" - , "#fe612f" - , "#fe3f2f" + [ "#82ddd0" + , "#82d3dd" + , "#82bcdd" + , "#82a5dd" + , "#828edd" + , "#8d82dd" + , "#a482dd" + , "#bb82dd" ] --- SYSTEM +-- DND -config : DnDList.Config Item -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Item Msg +system : DnDList.Single.System Item Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + |> DnDList.Single.create DnDMsg @@ -74,20 +67,20 @@ type Item type alias Model = - { dnd : DnDList.Model - , items : List Item + { items : List Item + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , items = [] + { items = [] + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, commands ) @@ -115,12 +108,12 @@ commands = type Msg = NewMasonry (List Int) - | MyMsg DnDList.Msg + | DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of +update msg model = + case msg of NewMasonry widths -> ( { model | items = @@ -129,13 +122,13 @@ update message model = , Cmd.none ) - MyMsg msg -> + DnDMsg dndMsg -> let - ( dnd, items ) = - system.update msg model.dnd model.items + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd in - ( { model | dnd = dnd, items = items } - , system.commands dnd + ( { model | items = items, dnd = dndModel } + , dndCmd ) @@ -153,7 +146,7 @@ view model = ] -itemView : DnDList.Model -> Int -> Item -> Html.Html Msg +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg itemView dnd index (Item color width) = let itemId : String @@ -186,7 +179,7 @@ itemView dnd index (Item color width) = [] -ghostView : DnDList.Model -> List Item -> Html.Html Msg +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg ghostView dnd items = let maybeDragItem : Maybe Item @@ -215,8 +208,8 @@ containerStyles = [ Html.Attributes.style "display" "flex" , Html.Attributes.style "flex-wrap" "wrap" , Html.Attributes.style "margin" "0 auto" - , Html.Attributes.style "max-width" "40em" - , Html.Attributes.style "padding-top" "2em" + , Html.Attributes.style "max-width" "40rem" + , Html.Attributes.style "padding-top" "2rem" ] @@ -226,6 +219,6 @@ itemStyles color width = , Html.Attributes.style "cursor" "pointer" , Html.Attributes.style "flex" "1 0 auto" , Html.Attributes.style "height" "4.5rem" - , Html.Attributes.style "margin" "0 1.5em 1.5em 0" + , Html.Attributes.style "margin" "0 1.5rem 1.5rem 0" , Html.Attributes.style "width" (String.fromInt width ++ "px") ] diff --git a/examples/src/Introduction/Parent.elm b/examples/src/Introduction/Parent.elm new file mode 100755 index 0000000..55751c2 --- /dev/null +++ b/examples/src/Introduction/Parent.elm @@ -0,0 +1,430 @@ +module Introduction.Parent exposing + ( Example + , Msg + , chapterView + , init + , subscriptions + , update + , view + ) + +import AssocList +import CustomElement +import Dict +import Html +import Introduction.Basic +import Introduction.BasicElmUI +import Introduction.Groups +import Introduction.Handle +import Introduction.Independents +import Introduction.Keyed +import Introduction.Margins +import Introduction.Masonry +import Introduction.Resize +import Views + + + +-- WORKAROUND ENUM TYPE + + +defaultMeta : Views.Metadata Example +defaultMeta = + { segment = "basic" + , title = "Basic" + , description = "Plain sortable list without any styling" + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Basic.elm" + , initialModel = Basic Introduction.Basic.initialModel + } + + +meta : List (Views.Metadata Example) +meta = + [ defaultMeta + , { segment = "basic-elm-ui" + , title = "Basic + Elm UI" + , description = "Designed with mdgriffith/elm-ui" + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/BasicElmUI.elm" + , initialModel = BasicElmUI Introduction.BasicElmUI.initialModel + } + , { segment = "handle" + , title = "Drag handle" + , description = "Use a subelement as a drag handle." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Handle.elm" + , initialModel = Handle Introduction.Handle.initialModel + } + , { segment = "keyed" + , title = "Keyed nodes" + , description = "Use Html.Keyed for optimized DOM updates." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Keyed.elm" + , initialModel = Keyed Introduction.Keyed.initialModel + } + , { segment = "margins" + , title = "Margins" + , description = "Wrap elements in case top or left margins are needed." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Margins.elm" + , initialModel = Margins Introduction.Margins.initialModel + } + , { segment = "masonry" + , title = "Masonry" + , description = "Simple horizontal masonry." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Masonry.elm" + , initialModel = Masonry Introduction.Masonry.initialModel + } + , { segment = "resize" + , title = "Resize" + , description = "Put a drag handle to the top-left corner with resizable ghost element." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Resize.elm" + , initialModel = Resize Introduction.Resize.initialModel + } + , { segment = "independents" + , title = "Independent lists" + , description = "Without thinking: duplicate everything." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Independents.elm" + , initialModel = Independents Introduction.Independents.initialModel + } + , { segment = "groups" + , title = "Groupable items" + , description = "The list state invariant is that the list is gathered by the grouping property, and the auxiliary items preserve their places." + , link = "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Groups.elm" + , initialModel = Groups Introduction.Groups.initialModel + } + ] + + +type Tag + = BasicTag + | BasicElmUITag + | HandleTag + | KeyedTag + | MarginsTag + | MasonryTag + | ResizeTag + | IndependentsTag + | GroupsTag + + +allTags : List Tag +allTags = + let + ignored : Tag -> () + ignored tag = + case tag of + BasicTag -> + () + + BasicElmUITag -> + () + + HandleTag -> + () + + KeyedTag -> + () + + MarginsTag -> + () + + MasonryTag -> + () + + ResizeTag -> + () + + IndependentsTag -> + () + + GroupsTag -> + () + in + [ BasicTag + , BasicElmUITag + , HandleTag + , KeyedTag + , MarginsTag + , MasonryTag + , ResizeTag + , IndependentsTag + , GroupsTag + ] + + +exampleToTag : Example -> Tag +exampleToTag example = + case example of + Basic _ -> + BasicTag + + BasicElmUI _ -> + BasicElmUITag + + Handle _ -> + HandleTag + + Keyed _ -> + KeyedTag + + Margins _ -> + MarginsTag + + Masonry _ -> + MasonryTag + + Resize _ -> + ResizeTag + + Independents _ -> + IndependentsTag + + Groups _ -> + GroupsTag + + +tagSegmentDict : AssocList.Dict Tag (Views.Metadata Example) +tagSegmentDict = + List.map2 Tuple.pair allTags meta |> AssocList.fromList + + +tagToMetadata : Tag -> Views.Metadata Example +tagToMetadata tag = + Maybe.withDefault defaultMeta <| + case tag of + BasicTag -> + AssocList.get BasicTag tagSegmentDict + + BasicElmUITag -> + AssocList.get BasicElmUITag tagSegmentDict + + HandleTag -> + AssocList.get HandleTag tagSegmentDict + + KeyedTag -> + AssocList.get KeyedTag tagSegmentDict + + MarginsTag -> + AssocList.get MarginsTag tagSegmentDict + + MasonryTag -> + AssocList.get MasonryTag tagSegmentDict + + ResizeTag -> + AssocList.get ResizeTag tagSegmentDict + + IndependentsTag -> + AssocList.get IndependentsTag tagSegmentDict + + GroupsTag -> + AssocList.get GroupsTag tagSegmentDict + + + +-- MODEL + + +type Example + = Basic Introduction.Basic.Model + | BasicElmUI Introduction.BasicElmUI.Model + | Handle Introduction.Handle.Model + | Keyed Introduction.Keyed.Model + | Margins Introduction.Margins.Model + | Masonry Introduction.Masonry.Model + | Resize Introduction.Resize.Model + | Independents Introduction.Independents.Model + | Groups Introduction.Groups.Model + + +init : String -> ( Example, Cmd Msg ) +init segment = + ( meta + |> List.map (\m -> ( m.segment, m.initialModel )) + |> Dict.fromList + |> Dict.get segment + |> Maybe.withDefault defaultMeta.initialModel + , commands + ) + + + +-- UPDATE + + +type Msg + = BasicMsg Introduction.Basic.Msg + | BasicElmUIMsg Introduction.BasicElmUI.Msg + | HandleMsg Introduction.Handle.Msg + | KeyedMsg Introduction.Keyed.Msg + | MarginsMsg Introduction.Margins.Msg + | MasonryMsg Introduction.Masonry.Msg + | ResizeMsg Introduction.Resize.Msg + | IndependentsMsg Introduction.Independents.Msg + | GroupsMsg Introduction.Groups.Msg + + +commands : Cmd Msg +commands = + Cmd.map MasonryMsg Introduction.Masonry.commands + + +subscriptions : Example -> Sub Msg +subscriptions example = + case example of + Basic subModel -> + Sub.map BasicMsg (Introduction.Basic.subscriptions subModel) + + BasicElmUI subModel -> + Sub.map BasicElmUIMsg (Introduction.BasicElmUI.subscriptions subModel) + + Handle subModel -> + Sub.map HandleMsg (Introduction.Handle.subscriptions subModel) + + Keyed subModel -> + Sub.map KeyedMsg (Introduction.Keyed.subscriptions subModel) + + Margins subModel -> + Sub.map MarginsMsg (Introduction.Margins.subscriptions subModel) + + Masonry subModel -> + Sub.map MasonryMsg (Introduction.Masonry.subscriptions subModel) + + Resize subModel -> + Sub.map ResizeMsg (Introduction.Resize.subscriptions subModel) + + Independents subModel -> + Sub.map IndependentsMsg (Introduction.Independents.subscriptions subModel) + + Groups subModel -> + Sub.map GroupsMsg (Introduction.Groups.subscriptions subModel) + + +update : Msg -> Example -> ( Example, Cmd Msg ) +update msg example = + case ( msg, example ) of + ( BasicMsg subMsg, Basic subModel ) -> + stepBasic (Introduction.Basic.update subMsg subModel) + + ( BasicElmUIMsg subMsg, BasicElmUI subModel ) -> + stepBasicElmUI (Introduction.BasicElmUI.update subMsg subModel) + + ( HandleMsg subMsg, Handle subModel ) -> + stepHandle (Introduction.Handle.update subMsg subModel) + + ( KeyedMsg subMsg, Keyed subModel ) -> + stepKeyed (Introduction.Keyed.update subMsg subModel) + + ( MarginsMsg subMsg, Margins subModel ) -> + stepMargins (Introduction.Margins.update subMsg subModel) + + ( MasonryMsg subMsg, Masonry subModel ) -> + stepMasonry (Introduction.Masonry.update subMsg subModel) + + ( ResizeMsg subMsg, Resize subModel ) -> + stepResize (Introduction.Resize.update subMsg subModel) + + ( IndependentsMsg subMsg, Independents subModel ) -> + stepIndependents (Introduction.Independents.update subMsg subModel) + + ( GroupsMsg subMsg, Groups subModel ) -> + stepGroups (Introduction.Groups.update subMsg subModel) + + _ -> + ( example, Cmd.none ) + + +stepBasic : ( Introduction.Basic.Model, Cmd Introduction.Basic.Msg ) -> ( Example, Cmd Msg ) +stepBasic ( subModel, subCmd ) = + ( Basic subModel, Cmd.map BasicMsg subCmd ) + + +stepBasicElmUI : ( Introduction.BasicElmUI.Model, Cmd Introduction.BasicElmUI.Msg ) -> ( Example, Cmd Msg ) +stepBasicElmUI ( subModel, subCmd ) = + ( BasicElmUI subModel, Cmd.map BasicElmUIMsg subCmd ) + + +stepHandle : ( Introduction.Handle.Model, Cmd Introduction.Handle.Msg ) -> ( Example, Cmd Msg ) +stepHandle ( subModel, subCmd ) = + ( Handle subModel, Cmd.map HandleMsg subCmd ) + + +stepKeyed : ( Introduction.Keyed.Model, Cmd Introduction.Keyed.Msg ) -> ( Example, Cmd Msg ) +stepKeyed ( subModel, subCmd ) = + ( Keyed subModel, Cmd.map KeyedMsg subCmd ) + + +stepMargins : ( Introduction.Margins.Model, Cmd Introduction.Margins.Msg ) -> ( Example, Cmd Msg ) +stepMargins ( subModel, subCmd ) = + ( Margins subModel, Cmd.map MarginsMsg subCmd ) + + +stepMasonry : ( Introduction.Masonry.Model, Cmd Introduction.Masonry.Msg ) -> ( Example, Cmd Msg ) +stepMasonry ( subModel, subCmd ) = + ( Masonry subModel, Cmd.map MasonryMsg subCmd ) + + +stepResize : ( Introduction.Resize.Model, Cmd Introduction.Resize.Msg ) -> ( Example, Cmd Msg ) +stepResize ( subModel, subCmd ) = + ( Resize subModel, Cmd.map ResizeMsg subCmd ) + + +stepIndependents : ( Introduction.Independents.Model, Cmd Introduction.Independents.Msg ) -> ( Example, Cmd Msg ) +stepIndependents ( subModel, subCmd ) = + ( Independents subModel, Cmd.map IndependentsMsg subCmd ) + + +stepGroups : ( Introduction.Groups.Model, Cmd Introduction.Groups.Msg ) -> ( Example, Cmd Msg ) +stepGroups ( subModel, subCmd ) = + ( Groups subModel, Cmd.map GroupsMsg subCmd ) + + + +-- VIEW + + +view : Example -> List (Html.Html Msg) +view example = + [ Views.demoHeaderView + (example + |> exampleToTag + |> tagToMetadata + |> (\m -> { title = m.title, description = m.description, link = m.link }) + ) + , case example of + Basic subModel -> + Html.map BasicMsg (Introduction.Basic.view subModel) + + BasicElmUI subModel -> + Html.map BasicElmUIMsg (Introduction.BasicElmUI.view subModel) + + Handle subModel -> + Html.map HandleMsg (Introduction.Handle.view subModel) + + Keyed subModel -> + Html.map KeyedMsg (Introduction.Keyed.view subModel) + + Margins subModel -> + Html.map MarginsMsg (Introduction.Margins.view subModel) + + Masonry subModel -> + Html.map MasonryMsg (Introduction.Masonry.view subModel) + + Resize subModel -> + Html.map ResizeMsg (Introduction.Resize.view subModel) + + Independents subModel -> + Html.map IndependentsMsg (Introduction.Independents.view subModel) + + Groups subModel -> + Html.map GroupsMsg (Introduction.Groups.view subModel) + , CustomElement.elmCode + [ CustomElement.href (example |> exampleToTag |> tagToMetadata |> (\m -> m.link)) ] + [] + ] + + +chapterView : String -> Html.Html msg +chapterView class = + Views.chapterView + class + { title = "Introduction" + , slug = "introduction" + , allTags = allTags |> List.map (tagToMetadata >> (\m -> { segment = m.segment, title = m.title })) + } diff --git a/examples/src/Introduction/Resize.elm b/examples/src/Introduction/Resize.elm index 611fa70..1a70949 100755 --- a/examples/src/Introduction/Resize.elm +++ b/examples/src/Introduction/Resize.elm @@ -2,6 +2,7 @@ module Introduction.Resize exposing (Model, Msg, initialModel, main, subscriptio import Browser import DnDList +import DnDList.Single import Html import Html.Attributes @@ -55,21 +56,15 @@ spots = --- SYSTEM +-- DND -config : DnDList.Config Color -config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Swap - } - - -system : DnDList.System Color Msg +system : DnDList.Single.System Color Msg system = - DnDList.create config MyMsg + DnDList.Single.config + |> DnDList.Single.operation DnDList.Swap + --|> DnDList.Single.ghost [ "positionTopLeft" ] + |> DnDList.Single.create DnDMsg @@ -77,20 +72,20 @@ system = type alias Model = - { dnd : DnDList.Model - , colors : List Color + { colors : List Color + , dnd : DnDList.Single.Model } initialModel : Model initialModel = - { dnd = system.model - , colors = data + { colors = data + , dnd = system.model } init : () -> ( Model, Cmd Msg ) -init _ = +init () = ( initialModel, Cmd.none ) @@ -108,22 +103,19 @@ subscriptions model = type Msg - = MyMsg DnDList.Msg + = DnDMsg DnDList.Single.Msg update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case message of - MyMsg msg -> +update msg model = + case msg of + DnDMsg dndMsg -> let - ( dnd, colors ) = - system.update msg model.dnd model.colors + ( colors, dndModel, dndCmd ) = + system.update model.colors dndMsg model.dnd in - ( { model - | dnd = dnd - , colors = colors - } - , system.commands dnd + ( { model | colors = colors, dnd = dndModel } + , dndCmd ) @@ -164,23 +156,16 @@ itemView model index ( color, spot ) = :: itemStyles width height color ++ system.dropEvents index itemId ) - [ Html.div - handleStyles - [ Html.text "⠶" ] - ] + [ Html.div handleStyles [ Html.text "⠶" ] ] else Html.div - (Html.Attributes.id itemId - :: itemStyles width height gray - ) + (Html.Attributes.id itemId :: itemStyles width height gray) [] _ -> Html.div - (Html.Attributes.id itemId - :: itemStyles width height color - ) + (Html.Attributes.id itemId :: itemStyles width height color) [ Html.div (handleStyles ++ system.dragEvents index itemId) [ Html.text "⠶" ] @@ -208,10 +193,7 @@ ghostView model = , Html.Attributes.style "transition" "width 0.5s, height 0.5s" ] ) - [ Html.div - handleStyles - [ Html.text "⠶" ] - ] + [ Html.div handleStyles [ Html.text "⠶" ] ] _ -> Html.text "" @@ -258,7 +240,7 @@ yellow = gray : Color gray = - "dimgray" + "gainsboro" diff --git a/examples/src/Introduction/Root.elm b/examples/src/Introduction/Root.elm deleted file mode 100755 index 14613b8..0000000 --- a/examples/src/Introduction/Root.elm +++ /dev/null @@ -1,417 +0,0 @@ -module Introduction.Root exposing - ( Model - , Msg - , codeView - , demoView - , headerView - , init - , navigationView - , subscriptions - , update - ) - -import CustomElement -import Html -import Html.Attributes -import Introduction.Basic -import Introduction.BasicElmUI -import Introduction.Groups -import Introduction.Handle -import Introduction.Independents -import Introduction.Keyed -import Introduction.Margins -import Introduction.Masonry -import Introduction.Resize -import Path -import Url.Builder - - - --- MODEL - - -type alias Model = - Example - - -type Example - = Basic Introduction.Basic.Model - | BasicElmUI Introduction.BasicElmUI.Model - | Handle Introduction.Handle.Model - | Keyed Introduction.Keyed.Model - | Margins Introduction.Margins.Model - | Masonry Introduction.Masonry.Model - | Resize Introduction.Resize.Model - | Independents Introduction.Independents.Model - | Groups Introduction.Groups.Model - - -init : String -> ( Model, Cmd Msg ) -init slug = - ( toExample slug, commands ) - - - --- UPDATE - - -type Msg - = BasicMsg Introduction.Basic.Msg - | BasicElmUIMsg Introduction.BasicElmUI.Msg - | HandleMsg Introduction.Handle.Msg - | KeyedMsg Introduction.Keyed.Msg - | MarginsMsg Introduction.Margins.Msg - | MasonryMsg Introduction.Masonry.Msg - | ResizeMsg Introduction.Resize.Msg - | IndependentsMsg Introduction.Independents.Msg - | GroupsMsg Introduction.Groups.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case ( message, model ) of - ( BasicMsg msg, Basic mo ) -> - stepBasic (Introduction.Basic.update msg mo) - - ( BasicElmUIMsg msg, BasicElmUI mo ) -> - stepBasicElmUI (Introduction.BasicElmUI.update msg mo) - - ( HandleMsg msg, Handle mo ) -> - stepHandle (Introduction.Handle.update msg mo) - - ( KeyedMsg msg, Keyed mo ) -> - stepKeyed (Introduction.Keyed.update msg mo) - - ( MarginsMsg msg, Margins mo ) -> - stepMargins (Introduction.Margins.update msg mo) - - ( MasonryMsg msg, Masonry mo ) -> - stepMasonry (Introduction.Masonry.update msg mo) - - ( ResizeMsg msg, Resize mo ) -> - stepResize (Introduction.Resize.update msg mo) - - ( IndependentsMsg msg, Independents mo ) -> - stepIndependents (Introduction.Independents.update msg mo) - - ( GroupsMsg msg, Groups mo ) -> - stepGroups (Introduction.Groups.update msg mo) - - _ -> - ( model, Cmd.none ) - - -stepBasic : ( Introduction.Basic.Model, Cmd Introduction.Basic.Msg ) -> ( Model, Cmd Msg ) -stepBasic ( mo, cmds ) = - ( Basic mo, Cmd.map BasicMsg cmds ) - - -stepBasicElmUI : ( Introduction.BasicElmUI.Model, Cmd Introduction.BasicElmUI.Msg ) -> ( Model, Cmd Msg ) -stepBasicElmUI ( mo, cmds ) = - ( BasicElmUI mo, Cmd.map BasicElmUIMsg cmds ) - - -stepHandle : ( Introduction.Handle.Model, Cmd Introduction.Handle.Msg ) -> ( Model, Cmd Msg ) -stepHandle ( mo, cmds ) = - ( Handle mo, Cmd.map HandleMsg cmds ) - - -stepKeyed : ( Introduction.Keyed.Model, Cmd Introduction.Keyed.Msg ) -> ( Model, Cmd Msg ) -stepKeyed ( mo, cmds ) = - ( Keyed mo, Cmd.map KeyedMsg cmds ) - - -stepMargins : ( Introduction.Margins.Model, Cmd Introduction.Margins.Msg ) -> ( Model, Cmd Msg ) -stepMargins ( mo, cmds ) = - ( Margins mo, Cmd.map MarginsMsg cmds ) - - -stepMasonry : ( Introduction.Masonry.Model, Cmd Introduction.Masonry.Msg ) -> ( Model, Cmd Msg ) -stepMasonry ( mo, cmds ) = - ( Masonry mo, Cmd.map MasonryMsg cmds ) - - -stepResize : ( Introduction.Resize.Model, Cmd Introduction.Resize.Msg ) -> ( Model, Cmd Msg ) -stepResize ( mo, cmds ) = - ( Resize mo, Cmd.map ResizeMsg cmds ) - - -stepIndependents : ( Introduction.Independents.Model, Cmd Introduction.Independents.Msg ) -> ( Model, Cmd Msg ) -stepIndependents ( mo, cmds ) = - ( Independents mo, Cmd.map IndependentsMsg cmds ) - - -stepGroups : ( Introduction.Groups.Model, Cmd Introduction.Groups.Msg ) -> ( Model, Cmd Msg ) -stepGroups ( mo, cmds ) = - ( Groups mo, Cmd.map GroupsMsg cmds ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - case model of - Basic mo -> - Sub.map BasicMsg (Introduction.Basic.subscriptions mo) - - BasicElmUI mo -> - Sub.map BasicElmUIMsg (Introduction.BasicElmUI.subscriptions mo) - - Handle mo -> - Sub.map HandleMsg (Introduction.Handle.subscriptions mo) - - Keyed mo -> - Sub.map KeyedMsg (Introduction.Keyed.subscriptions mo) - - Margins mo -> - Sub.map MarginsMsg (Introduction.Margins.subscriptions mo) - - Masonry mo -> - Sub.map MasonryMsg (Introduction.Masonry.subscriptions mo) - - Resize mo -> - Sub.map ResizeMsg (Introduction.Resize.subscriptions mo) - - Independents mo -> - Sub.map IndependentsMsg (Introduction.Independents.subscriptions mo) - - Groups mo -> - Sub.map GroupsMsg (Introduction.Groups.subscriptions mo) - - - --- COMMANDS - - -commands : Cmd Msg -commands = - Cmd.map MasonryMsg Introduction.Masonry.commands - - - --- VIEW - - -navigationView : String -> Html.Html Msg -navigationView currentPath = - Html.div - [ Html.Attributes.class "navigation" ] - [ Html.h4 [] [ Html.text "Introduction" ] - , [ Basic Introduction.Basic.initialModel - , BasicElmUI Introduction.BasicElmUI.initialModel - , Handle Introduction.Handle.initialModel - , Keyed Introduction.Keyed.initialModel - , Margins Introduction.Margins.initialModel - , Masonry Introduction.Masonry.initialModel - , Resize Introduction.Resize.initialModel - , Independents Introduction.Independents.initialModel - , Groups Introduction.Groups.initialModel - ] - |> List.map (linkView currentPath) - |> Html.ul [] - ] - - -linkView : String -> Example -> Html.Html Msg -linkView currentPath example = - let - path : String - path = - Url.Builder.absolute [ Path.rootPath, "introduction", (info >> .slug) example ] [] - in - Html.li [] - [ Html.a - [ Html.Attributes.classList [ ( "is-active", path == currentPath ) ] - , Html.Attributes.href path - ] - [ Html.text ((info >> .title) example) ] - ] - - -headerView : Model -> Html.Html Msg -headerView model = - let - title : String - title = - (info >> .title) model - - description : String - description = - (info >> .description) model - in - Html.header [] - [ Html.h2 [] [ Html.text title ] - , Html.p [] [ Html.text description ] - ] - - -demoView : Model -> Html.Html Msg -demoView model = - case model of - Basic mo -> - Html.map BasicMsg (Introduction.Basic.view mo) - - BasicElmUI mo -> - Html.map BasicElmUIMsg (Introduction.BasicElmUI.view mo) - - Handle mo -> - Html.map HandleMsg (Introduction.Handle.view mo) - - Keyed mo -> - Html.map KeyedMsg (Introduction.Keyed.view mo) - - Margins mo -> - Html.map MarginsMsg (Introduction.Margins.view mo) - - Masonry mo -> - Html.map MasonryMsg (Introduction.Masonry.view mo) - - Resize mo -> - Html.map ResizeMsg (Introduction.Resize.view mo) - - Independents mo -> - Html.map IndependentsMsg (Introduction.Independents.view mo) - - Groups mo -> - Html.map GroupsMsg (Introduction.Groups.view mo) - - -codeView : Model -> Html.Html Msg -codeView model = - case model of - Basic _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Basic.elm" - - BasicElmUI _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/BasicElmUI.elm" - - Handle _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Handle.elm" - - Keyed _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Keyed.elm" - - Margins _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Margins.elm" - - Masonry _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Masonry.elm" - - Resize _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Resize.elm" - - Independents _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Independents.elm" - - Groups _ -> - toCode "https://raw.githubusercontent.com/annaghi/dnd-list/master/examples/src/Introduction/Groups.elm" - - -toCode : String -> Html.Html msg -toCode url = - CustomElement.elmCode [ CustomElement.href url ] [] - - - --- EXAMPLE INFO - - -toExample : String -> Example -toExample slug = - case slug of - "basic" -> - Basic Introduction.Basic.initialModel - - "basic-elm-ui" -> - BasicElmUI Introduction.BasicElmUI.initialModel - - "handle" -> - Handle Introduction.Handle.initialModel - - "keyed" -> - Keyed Introduction.Keyed.initialModel - - "margins" -> - Margins Introduction.Margins.initialModel - - "masonry" -> - Masonry Introduction.Masonry.initialModel - - "resize" -> - Resize Introduction.Resize.initialModel - - "independents" -> - Independents Introduction.Independents.initialModel - - "groups" -> - Groups Introduction.Groups.initialModel - - _ -> - Basic Introduction.Basic.initialModel - - -type alias Info = - { slug : String - , title : String - , description : String - } - - -info : Example -> Info -info example = - case example of - Basic _ -> - { slug = "basic" - , title = "Basic" - , description = "Plain sortable list" - } - - BasicElmUI _ -> - { slug = "basic-elm-ui" - , title = "Basic + Elm UI" - , description = "Designed with mdgriffith/elm-ui" - } - - Handle _ -> - { slug = "handle" - , title = "Drag handle" - , description = "Use a subelement as a drag handle." - } - - Keyed _ -> - { slug = "keyed" - , title = "Keyed nodes" - , description = "Use Html.Keyed for optimized DOM updates." - } - - Margins _ -> - { slug = "margins" - , title = "Margins" - , description = "Wrap elements in case top or left margins are needed." - } - - Masonry _ -> - { slug = "masonry" - , title = "Masonry" - , description = "Simple horizontal masonry." - } - - Resize _ -> - { slug = "resize" - , title = "Resize" - , description = "Put a drag handle to the top-left corner with resizable ghost element." - } - - Independents _ -> - { slug = "independents" - , title = "Independent lists" - , description = "Without thinking: duplicate everything." - } - - Groups _ -> - { slug = "groups" - , title = "Groupable items" - , description = "The list state invariant is that the list is gathered by the grouping property, and the auxiliary items preserve their places." - } diff --git a/examples/src/Main.elm b/examples/src/Main.elm old mode 100755 new mode 100644 index 41b2a43..945036b --- a/examples/src/Main.elm +++ b/examples/src/Main.elm @@ -3,18 +3,14 @@ module Main exposing (main) import Browser import Browser.Dom import Browser.Navigation -import Config.Root -import ConfigGroups.Root -import Gallery.Root +import Demo +import Global import Home import Html -import Html.Attributes -import Introduction.Root -import Path +import Router import Task import Url -import Url.Builder -import Url.Parser exposing (()) +import Views @@ -28,147 +24,84 @@ main = , view = view , update = update , subscriptions = subscriptions - , onUrlChange = UrlChanged - , onUrlRequest = LinkClicked + , onUrlChange = OnUrlChange + , onUrlRequest = OnUrlRequest } --- MODEL - - -type alias Model = - { key : Browser.Navigation.Key - , example : Example - , path : String - } - - -init : () -> Url.Url -> Browser.Navigation.Key -> ( Model, Cmd Msg ) -init flags url key = - stepUrl url { key = key, example = NotFound, path = toPath url } - - -type Example - = NotFound - | Home Home.Model - | Introduction Introduction.Root.Model - | Config Config.Root.Model - | ConfigGroups ConfigGroups.Root.Model - | Gallery Gallery.Root.Model - - - --- UPDATE - - -type Msg - = NoOp - | LinkClicked Browser.UrlRequest - | UrlChanged Url.Url - | HomeMsg Home.Msg - | IntroductionMsg Introduction.Root.Msg - | ConfigMsg Config.Root.Msg - | ConfigGroupsMsg ConfigGroups.Root.Msg - | GalleryMsg Gallery.Root.Msg - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update message model = - case ( message, model.example ) of - ( NoOp, _ ) -> - ( model, Cmd.none ) - - ( LinkClicked urlRequest, _ ) -> - case urlRequest of - Browser.Internal url -> - ( { model | path = toPath url } - , Cmd.batch - [ Browser.Navigation.pushUrl model.key (Url.toString url) - , jumpToTop "main" - ] - ) - - Browser.External href -> - ( model - , Browser.Navigation.load href - ) - - ( UrlChanged url, _ ) -> - stepUrl url model - - ( HomeMsg msg, Home mo ) -> - stepHome model (Home.update msg mo) - - ( IntroductionMsg msg, Introduction mo ) -> - stepIntroduction model (Introduction.Root.update msg mo) - - ( ConfigMsg msg, Config mo ) -> - stepConfig model (Config.Root.update msg mo) - - ( ConfigGroupsMsg msg, ConfigGroups mo ) -> - stepConfigGroups model (ConfigGroups.Root.update msg mo) - - ( GalleryMsg msg, Gallery mo ) -> - stepGallery model (Gallery.Root.update msg mo) - - _ -> - ( model, Cmd.none ) - - -stepHome : Model -> ( Home.Model, Cmd Home.Msg ) -> ( Model, Cmd Msg ) -stepHome model ( mo, cmds ) = - ( { model | example = Home mo }, Cmd.map HomeMsg cmds ) - - -stepIntroduction : Model -> ( Introduction.Root.Model, Cmd Introduction.Root.Msg ) -> ( Model, Cmd Msg ) -stepIntroduction model ( mo, cmds ) = - ( { model | example = Introduction mo }, Cmd.map IntroductionMsg cmds ) - - -stepConfig : Model -> ( Config.Root.Model, Cmd Config.Root.Msg ) -> ( Model, Cmd Msg ) -stepConfig model ( mo, cmds ) = - ( { model | example = Config mo }, Cmd.map ConfigMsg cmds ) - +-- ROUTER -stepConfigGroups : Model -> ( ConfigGroups.Root.Model, Cmd ConfigGroups.Root.Msg ) -> ( Model, Cmd Msg ) -stepConfigGroups model ( mo, cmds ) = - ( { model | example = ConfigGroups mo }, Cmd.map ConfigGroupsMsg cmds ) +type Page + = Home + | Demo Demo.Example + | NotFound -stepGallery : Model -> ( Gallery.Root.Model, Cmd Gallery.Root.Msg ) -> ( Model, Cmd Msg ) -stepGallery model ( mo, cmds ) = - ( { model | example = Gallery mo }, Cmd.map GalleryMsg cmds ) +routePage : Router.Route -> Model -> ( Model, Cmd Msg ) +routePage route model = + let + genPage : ( Page, Cmd Msg ) + genPage = + case route of + Router.Home -> + ( Home, Cmd.none ) + + Router.Demo a b -> + Demo.init a b + |> Tuple.mapFirst Demo + |> Tuple.mapSecond (Cmd.map DemoMsg) + + Router.NotFound -> + ( NotFound, Cmd.none ) + in + ( { model + | page = Tuple.first genPage + , route = route + } + , Cmd.batch + [ Tuple.second genPage + , Task.perform (\_ -> GlobalMsg Global.ShowMenu) (Task.succeed ()) + + -- , jumpToTop "dnd" + ] + ) --- SUBSCRIPTIONS +-- MODEL -subscriptions : Model -> Sub Msg -subscriptions model = - case model.example of - NotFound -> - Sub.none - Home mo -> - Sub.map HomeMsg (Home.subscriptions mo) +type alias Model = + { key : Browser.Navigation.Key + , route : Router.Route + , global : Global.Model + , page : Page + } - Introduction mo -> - Sub.map IntroductionMsg (Introduction.Root.subscriptions mo) - Config mo -> - Sub.map ConfigMsg (Config.Root.subscriptions mo) +init : () -> Url.Url -> Browser.Navigation.Key -> ( Model, Cmd Msg ) +init () url key = + routePage + (Router.route url) + { key = key + , route = Router.route url + , global = Global.initialModel -- No commands yet + , page = NotFound + } - ConfigGroups mo -> - Sub.map ConfigGroupsMsg (ConfigGroups.Root.subscriptions mo) - Gallery mo -> - Sub.map GalleryMsg (Gallery.Root.subscriptions mo) +-- UPDATE --- COMMANDS +type Msg + = OnUrlRequest Browser.UrlRequest + | OnUrlChange Url.Url + | GlobalMsg Global.Msg + | DemoMsg Demo.Msg + | NoOp jumpToTop : String -> Cmd Msg @@ -178,64 +111,58 @@ jumpToTop id = |> Task.attempt (\_ -> NoOp) +subscriptions : Model -> Sub Msg +subscriptions model = + case model.page of + Home -> + Sub.none + + Demo mo -> + Sub.map DemoMsg (Demo.subscriptions mo) + + NotFound -> + Sub.none --- ROUTER +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + OnUrlRequest (Browser.Internal location) -> + ( model + , Browser.Navigation.pushUrl model.key (Url.toString location) + ) -stepUrl : Url.Url -> Model -> ( Model, Cmd Msg ) -stepUrl url model = - let - parser : Url.Parser.Parser (( Model, Cmd Msg ) -> b) b - parser = - Url.Parser.oneOf - [ Url.Parser.map - (stepGallery model (Gallery.Root.init "hanoi")) - Url.Parser.top - , Url.Parser.map - (stepGallery model (Gallery.Root.init "hanoi")) - (Url.Parser.s Path.rootPath) - , Url.Parser.map - (\slug -> - stepIntroduction model (Introduction.Root.init slug) - ) - (Url.Parser.s Path.rootPath Url.Parser.s "introduction" slug_) - , Url.Parser.map - (\slug -> - stepConfig model (Config.Root.init slug) - ) - (Url.Parser.s Path.rootPath Url.Parser.s "config" slug_) - , Url.Parser.map - (\slug -> - stepConfigGroups model (ConfigGroups.Root.init slug) - ) - (Url.Parser.s Path.rootPath Url.Parser.s "config-groups" slug_) - , Url.Parser.map - (\slug -> - stepGallery model (Gallery.Root.init slug) - ) - (Url.Parser.s Path.rootPath Url.Parser.s "gallery" slug_) - ] - in - case Url.Parser.parse parser url of - Nothing -> - ( { model | example = NotFound }, Cmd.none ) + OnUrlRequest (Browser.External url) -> + ( model + -- TODO Check this if statement + , if String.isEmpty url then + Cmd.none - Just answer -> - answer + else + Browser.Navigation.load url + ) + OnUrlChange url -> + routePage (Router.route url) model -slug_ : Url.Parser.Parser (String -> a) a -slug_ = - Url.Parser.custom "SLUG" Just + GlobalMsg globalMsg -> + Global.update globalMsg model.global + |> Tuple.mapFirst (\m -> { model | global = m }) + |> Tuple.mapSecond (Cmd.map GlobalMsg) + DemoMsg demoMsg -> + case model.page of + Demo mo -> + -- TODO Check if Browser.Navigation.pushUrl key is needed + Demo.update model.key demoMsg mo + |> Tuple.mapFirst (\m -> { model | page = Demo m }) + |> Tuple.mapSecond (Cmd.map DemoMsg) -toPath : Url.Url -> String -toPath url = - if (url.path == "/" ++ Path.rootPath) || (url.path == "/" ++ Path.rootPath ++ "/") then - Url.Builder.absolute [ Path.rootPath, "gallery", "hanoi" ] [] + _ -> + ( model, Cmd.none ) - else - url.path + _ -> + ( model, Cmd.none ) @@ -246,69 +173,18 @@ view : Model -> Browser.Document Msg view model = { title = "annaghi | dnd-list" , body = - [ Html.div - [ Html.Attributes.id "sidebar" ] - [ cardView - , Html.nav [] - [ Html.map IntroductionMsg (Introduction.Root.navigationView model.path) - , Html.map ConfigMsg (Config.Root.navigationView model.path) - , Html.map ConfigGroupsMsg (ConfigGroups.Root.navigationView model.path) - , Html.map GalleryMsg (Gallery.Root.navigationView model.path) - ] - ] - , Html.main_ - [ Html.Attributes.id "main" ] - (case model.example of + Views.bodyView + (GlobalMsg Global.ShowMenu) + (model.page == Home) + (case model.page of + Home -> + Home.view + + Demo mo -> + Html.map DemoMsg (Demo.view model.global.showMenu mo) + NotFound -> - [ Html.text "Not found" ] - - Home mo -> - [ Html.map HomeMsg (Home.view mo) ] - - Introduction mo -> - [ Html.map IntroductionMsg (Introduction.Root.headerView mo) - , Html.map IntroductionMsg (Introduction.Root.demoView mo) - , Html.map IntroductionMsg (Introduction.Root.codeView mo) - ] - - Config mo -> - [ Html.map ConfigMsg (Config.Root.headerView mo) - , Html.map ConfigMsg (Config.Root.demoView mo) - , Html.map ConfigMsg (Config.Root.codeView mo) - ] - - ConfigGroups mo -> - [ Html.map ConfigGroupsMsg (ConfigGroups.Root.headerView mo) - , Html.map ConfigGroupsMsg (ConfigGroups.Root.demoView mo) - , Html.map ConfigGroupsMsg (ConfigGroups.Root.codeView mo) - ] - - Gallery mo -> - [ Html.map GalleryMsg (Gallery.Root.headerView mo) - , Html.map GalleryMsg (Gallery.Root.demoView mo) - , Html.map GalleryMsg (Gallery.Root.codeView mo) - ] + -- TODO Create a nice view for this page too + Html.text "Not found" ) - ] } - - -cardView : Html.Html Msg -cardView = - Html.header [] - [ Html.h1 [] - [ Html.a - [ Html.Attributes.href (Url.Builder.absolute [ Path.rootPath ] []) ] - [ Html.text "dnd-list" ] - ] - , Html.div [] - [ Html.a - [ Html.Attributes.href "https://github.com/annaghi/dnd-list" ] - [ Html.text "GitHub" ] - , Html.text " | " - , Html.a - [ Html.Attributes.href "https://package.elm-lang.org/packages/annaghi/dnd-list/latest" ] - [ Html.text "Docs" ] - ] - , Html.p [] [ Html.text "Drag and Drop for sortable lists in Elm web apps with mouse support" ] - ] diff --git a/examples/src/Router.elm b/examples/src/Router.elm new file mode 100644 index 0000000..f42b6b0 --- /dev/null +++ b/examples/src/Router.elm @@ -0,0 +1,34 @@ +module Router exposing (Route(..), route) + +import Path +import Url +import Url.Builder +import Url.Parser exposing (()) + + +type Route + = Home + | Demo String String + | NotFound + + +routes : Url.Parser.Parser (Route -> a) a +routes = + Url.Parser.oneOf + [ Url.Parser.map Home Url.Parser.top + , Url.Parser.map Home (Url.Parser.s Path.rootPath) + + -- Url.Parser.map Demo (Url.Parser.top Url.Parser.string Url.Parser.string) + --, Url.Parser.map Demo (Url.Parser.s Path.rootPath Url.Parser.string Url.Parser.string) + --, Url.Parser.map Demo (Url.Parser.s Path.rootPath Url.Parser.string Url.Parser.string) + , Url.Parser.map Demo (Url.Parser.s Path.rootPath Url.Parser.string Url.Parser.string) + ] + + +route : Url.Url -> Route +route url = + --if (url.path == "/") || (url.path == "/" ++ Path.rootPath) || (url.path == "/" ++ Path.rootPath ++ "/") then + -- Demo "introduction" "basic" + -- + --else + (Url.Parser.parse routes >> Maybe.withDefault NotFound) url diff --git a/examples/src/Views.elm b/examples/src/Views.elm new file mode 100644 index 0000000..db93c5b --- /dev/null +++ b/examples/src/Views.elm @@ -0,0 +1,207 @@ +module Views exposing (..) + +import Html +import Html.Attributes +import Html.Events +import Icons +import Path +import Url.Builder +import WeakCss + + +type alias Metadata example = + { segment : String + , title : String + , description : String + , link : String + , initialModel : example + } + + +type alias BlockMetadata = + { title : String + , slug : String + , allTags : List { segment : String, title : String } + } + + +type alias Info = + { slug : String + , title : String + , description : String + , link : String + } + + +type alias SubInfo msg = + { title : String + , subView : Html.Html msg + , link : String + } + + +type alias MenuMeta example = + { title : String + , slug : String + , info : example -> Info + , initialModels : List example + } + + +moduleClass : WeakCss.ClassName +moduleClass = + WeakCss.namespace "dnd" + + +bodyView : msg -> Bool -> Html.Html msg -> List (Html.Html msg) +bodyView showMenu isHome mainContent = + [ navView showMenu isHome + , mainContent + , footerView + ] + + +navView : msg -> Bool -> Html.Html msg +navView showMenu isHome = + Html.nav + [ moduleClass |> WeakCss.add "nav" |> WeakCss.withStates [ ( "home", isHome ) ] ] + [ Html.a + [ moduleClass |> WeakCss.nestMany [ "nav", "brand" ] + , Html.Attributes.href (Url.Builder.absolute [ Path.rootPath ] []) + ] + [ Html.text "annaghi/dnd-list" ] + , Html.a + [ moduleClass |> WeakCss.addMany [ "nav", "icon" ] |> WeakCss.withStates [ ( "github", True ) ] + , Html.Attributes.href "https://github.com/annaghi/dnd-list" + ] + [ Icons.githubLogo ] + , Html.a + [ moduleClass |> WeakCss.addMany [ "nav", "icon" ] |> WeakCss.withStates [ ( "docs", True ) ] + , Html.Attributes.href "https://package.elm-lang.org/packages/annaghi/dnd-list/latest" + ] + [ Icons.elmLogo ] + , Html.div + [ moduleClass |> WeakCss.addMany [ "nav", "icon" ] |> WeakCss.withStates [ ( "menu", True ) ] + , Html.Events.onClick showMenu + ] + -- TODO Draw a better icon with top padding + [ Icons.hamburger ] + ] + + +footerView : Html.Html msg +footerView = + Html.footer + [ moduleClass |> WeakCss.nest "footer" ] + [ Html.text "© 2019 - 2020 Anna Bansaghi" ] + + + +--
CONTENT + + +homeView : List (Html.Html msg) -> Html.Html msg +homeView chapters = + Html.main_ + [ moduleClass |> WeakCss.nest "home" ] + [ Html.section + [ moduleClass |> WeakCss.nestMany [ "home", "intro" ] ] + [ Html.h1 + [ moduleClass |> WeakCss.nestMany [ "home", "intro", "name" ] ] + [ Html.text "elm dnd-list" ] + , Html.div + [ moduleClass |> WeakCss.nestMany [ "home", "intro", "description" ] ] + [ Html.text "Drag and Drop for sortable lists in " + , Html.a [ Html.Attributes.target "_blank" ] [ Html.text "elm" ] + , Html.text " with mouse support" + ] + ] + , Html.section + [ moduleClass |> WeakCss.nestMany [ "home", "chapters" ] ] + chapters + ] + + + +-- LEVEL 2 NAVIGATION + + +chapterView : String -> BlockMetadata -> Html.Html msg +chapterView class { title, slug, allTags } = + Html.div + [ moduleClass |> WeakCss.nestMany [ class, "chapters", "chapter" ] ] + [ Html.h2 + [ moduleClass |> WeakCss.nestMany [ class, "chapters", "chapter", "title" ] ] + [ Html.text title ] + , allTags + |> List.map (linkView class slug) + |> Html.nav [ moduleClass |> WeakCss.nestMany [ class, "chapters", "chapter", "nav" ] ] + ] + + +linkView : String -> String -> { segment : String, title : String } -> Html.Html msg +linkView class slug { segment, title } = + let + path : String + path = + Url.Builder.absolute [ Path.rootPath, slug, segment ] [] + in + Html.a + [ moduleClass |> WeakCss.nestMany [ class, "chapters", "chapter", "nav", "link" ] + , Html.Attributes.href path + ] + [ Html.text title ] + + + +-- DEMO + + +demoHeaderView : { title : String, description : String, link : String } -> Html.Html msg +demoHeaderView { title, description, link } = + Html.div + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro" ] ] + [ Html.div + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro", "title" ] ] + [ Html.h1 + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro", "title", "text" ] ] + [ Html.text title ] + , Html.a + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro", "title", "link" ] + , Html.Attributes.href link + , Html.Attributes.target "_blank" + ] + [ Html.span + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro", "title", "link", "label" ] ] + [ Html.text "Get the code" ] + , Html.span + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro", "title", "link", "icon" ] ] + [ Icons.externalLink ] + ] + ] + , Html.div + [ moduleClass |> WeakCss.nestMany [ "demo", "content", "intro", "description" ] ] + [ Html.text description ] + ] + + +examplesView : (Int -> msg) -> (example -> SubInfo msg) -> Int -> List example -> Html.Html msg +examplesView linkClicked info currentId examples = + examples + |> List.indexedMap (exampleView linkClicked info currentId) + |> Html.ul [ moduleClass |> WeakCss.nestMany [ "demo", "examples" ] ] + + +exampleView : (Int -> msg) -> (example -> SubInfo msg) -> Int -> Int -> example -> Html.Html msg +exampleView linkClicked info currentId id example = + Html.li + [ moduleClass |> WeakCss.nestMany [ "demo", "examples", "item" ] ] + [ Html.h2 + [ moduleClass + |> WeakCss.addMany [ "demo", "examples", "item", "title" ] + |> WeakCss.withStates [ ( "link", True ), ( "is-active", id == currentId ) ] + , Html.Events.onClick (linkClicked id) + ] + [ Html.text (info example |> .title) ] + , info example |> .subView + ] diff --git a/experiments/elm.json b/experiments/elm.json old mode 100755 new mode 100644 index 2ca1cbe..f352e95 --- a/experiments/elm.json +++ b/experiments/elm.json @@ -1,28 +1,26 @@ { - "type": "application", - "source-directories": [ - "src", - "../src" - ], - "elm-version": "0.19.1", - "dependencies": { - "direct": { - "elm/browser": "1.0.2", - "elm/core": "1.0.5", - "elm/html": "1.0.0", - "elm/json": "1.1.3", - "elm/random": "1.0.0", - "elm/svg": "1.0.1", - "elm/url": "1.0.0", - "mdgriffith/elm-ui": "1.1.5" + "type": "application", + "source-directories": [ + "src", + "../src" + ], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "elm/browser": "1.0.2", + "elm/core": "1.0.5", + "elm/html": "1.0.0", + "elm/json": "1.1.3", + "turboMaCk/glue": "6.2.0" + }, + "indirect": { + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.2" + } }, - "indirect": { - "elm/time": "1.0.0", - "elm/virtual-dom": "1.0.2" + "test-dependencies": { + "direct": {}, + "indirect": {} } - }, - "test-dependencies": { - "direct": {}, - "indirect": {} - } } \ No newline at end of file diff --git a/experiments/src/Groups.elm b/experiments/src/Groups.elm new file mode 100644 index 0000000..ed57330 --- /dev/null +++ b/experiments/src/Groups.elm @@ -0,0 +1,337 @@ +module Groups exposing (Model, Msg, init, subscriptions, update, view) + +import Browser +import DnDList +import DnDList.Groups +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = \_ -> init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type Group + = Left + | Right + + +type alias Item = + { group : Group + , value : String + , color : String + } + + +preparedData : List Item +preparedData = + [ Item Left "C" blue + , Item Left "2" red + , Item Left "A" blue + , Item Left "footer" transparent + , Item Right "3" red + , Item Right "1" red + , Item Right "B" blue + , Item Right "footer" transparent + ] + + + +-- DND + + +system : DnDList.Groups.System Item Msg +system = + DnDList.Groups.config + |> DnDList.Groups.listen DnDList.OnDrag + |> DnDList.Groups.operation DnDList.Rotate + |> DnDList.Groups.groups + { listen = DnDList.OnDrag + , operation = DnDList.InsertBefore + , comparator = \item1 item2 -> item1.group == item2.group + , setter = \item1 item2 -> { item2 | group = item1.group } + } + |> DnDList.Groups.setItemsBeforeReorder (\_ _ list -> list) + |> DnDList.Groups.ghost [ "width", "height", "positionTopLeft" ] + |> DnDList.Groups.detectDrop DetectDrop + |> DnDList.Groups.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , dnd : DnDList.Groups.Model + } + + +initialModel : Model +initialModel = + { items = preparedData + , dnd = system.model + } + + +init : ( Model, Cmd Msg ) +init = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Groups.Msg + | DetectDrop Int Int (List Item) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + DetectDrop dragIndex dropIndex fruits -> + -- let + -- _ = + -- Debug.log "DetectDrop" dragIndex + -- _ = + -- Debug.log "DetectDrop" dropIndex + -- _ = + -- Debug.log "DetectDrop" fruits + -- in + ( model, Cmd.none ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section sectionStyles + [ groupView model Left lightRed + , groupView model Right lightBlue + , ghostView model.dnd model.items + ] + + +groupView : Model -> Group -> String -> Html.Html Msg +groupView model group color = + model.items + |> List.filter (\item -> item.group == group) + |> List.indexedMap (itemView model (calculateOffset 0 group model.items)) + |> Html.div (groupStyles color) + + +itemView : Model -> Int -> Int -> Item -> Html.Html Msg +itemView model offset localIndex { group, value, color } = + let + globalIndex : Int + globalIndex = + offset + localIndex + + itemId : String + itemId = + "groups-" ++ String.fromInt globalIndex + in + case ( system.info model.dnd, maybeDragItem model.dnd model.items ) of + ( Just { dragIndex }, Just dragItem ) -> + if color == transparent && value == "footer" && dragItem.group /= group then + Html.div + (Html.Attributes.id itemId + :: auxiliaryStyles + ++ system.dropEvents globalIndex itemId + ) + [] + + else if color == transparent && value == "footer" && dragItem.group == group then + Html.div + (Html.Attributes.id itemId + :: auxiliaryStyles + ) + [] + + else if dragIndex /= globalIndex then + Html.div + (Html.Attributes.id itemId + :: itemStyles color + ++ system.dropEvents globalIndex itemId + ) + [ Html.text value ] + + else + Html.div + (Html.Attributes.id itemId + :: itemStyles gray + ) + [] + + _ -> + if color == transparent && value == "footer" then + Html.div + (Html.Attributes.id itemId + :: auxiliaryStyles + ) + [] + + else + Html.div + (Html.Attributes.id itemId + :: itemStyles color + ++ system.dragEvents globalIndex itemId + ) + [ Html.text value ] + + +ghostView : DnDList.Groups.Model -> List Item -> Html.Html Msg +ghostView dnd items = + case maybeDragItem dnd items of + Just { value, color } -> + Html.div + (itemStyles color ++ system.ghostStyles dnd) + [ Html.text value ] + + Nothing -> + Html.text "" + + + +-- HELPERS + + +calculateOffset : Int -> Group -> List Item -> Int +calculateOffset index group list = + case list of + [] -> + 0 + + x :: xs -> + if x.group == group then + index + + else + calculateOffset (index + 1) group xs + + +maybeDragItem : DnDList.Groups.Model -> List Item -> Maybe Item +maybeDragItem dnd items = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + + + +-- COLORS + + +red : String +red = + "#c30005" + + +blue : String +blue = + "#0067c3" + + +lightRed : String +lightRed = + "#ea9088" + + +lightBlue : String +lightBlue = + "#88b0ea" + + +gray : String +gray = + "dimgray" + + +transparent : String +transparent = + "transparent" + + + +-- STYLES + + +sectionStyles : List (Html.Attribute msg) +sectionStyles = + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "top" + , Html.Attributes.style "justify-content" "center" + , Html.Attributes.style "align-items" "flex-start" + , Html.Attributes.style "padding-top" "2rem" + , Html.Attributes.style "height" "41rem" + ] + + +groupStyles : String -> List (Html.Attribute msg) +groupStyles color = + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "flex-direction" "column" + , Html.Attributes.style "background-color" color + , Html.Attributes.style "padding-top" "2rem" + , Html.Attributes.style "min-height" "19rem" + ] + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "width" "5rem" + , Html.Attributes.style "height" "5rem" + , Html.Attributes.style "background-color" color + , Html.Attributes.style "border-radius" "8px" + , Html.Attributes.style "color" "#ffffff" + , Html.Attributes.style "cursor" "pointer" + , Html.Attributes.style "margin" "0 auto 1rem auto" + , Html.Attributes.style "display" "flex" + , Html.Attributes.style "align-items" "center" + , Html.Attributes.style "justify-content" "center" + ] + + +{-| We can do much better with pseudo-classes. +-} +auxiliaryStyles : List (Html.Attribute msg) +auxiliaryStyles = + [ Html.Attributes.style "flex-grow" "1" + , Html.Attributes.style "height" "auto" + , Html.Attributes.style "min-height" "1rem" + , Html.Attributes.style "width" "8rem" + ] diff --git a/experiments/src/Main.elm b/experiments/src/Main.elm new file mode 100755 index 0000000..18c066b --- /dev/null +++ b/experiments/src/Main.elm @@ -0,0 +1,84 @@ +module Main exposing (main) + +import Browser +import Glue +import Groups +import Html +import Html.Attributes +import Single + + +main : Program () Model Msg +main = + Browser.element + { init = init + , view = view + , update = update + , subscriptions = subscriptions + } + + +single : Glue.Glue Model Single.Model Msg Single.Msg +single = + Glue.glue + { msg = SingleMsg + , get = .single + , set = \subModel model -> { model | single = subModel } + } + + +groups : Glue.Glue Model Groups.Model Msg Groups.Msg +groups = + Glue.glue + { msg = GroupsMsg + , get = .groups + , set = \subModel model -> { model | groups = subModel } + } + + +type alias Model = + { single : Single.Model + , groups : Groups.Model + } + + +init : () -> ( Model, Cmd Msg ) +init () = + ( Model, Cmd.none ) + |> Glue.init single Single.init + |> Glue.init groups Groups.init + + +type Msg + = SingleMsg Single.Msg + | GroupsMsg Groups.Msg + + +subscriptions : Model -> Sub Msg +subscriptions = + (\_ -> Sub.none) + |> Glue.subscriptions single Single.subscriptions + |> Glue.subscriptions groups Groups.subscriptions + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + SingleMsg singleMsg -> + ( model, Cmd.none ) + |> Glue.update single Single.update singleMsg + + GroupsMsg groupsMsg -> + ( model, Cmd.none ) + |> Glue.update groups Groups.update groupsMsg + + +view : Model -> Html.Html Msg +view model = + Html.div + [ Html.Attributes.style "display" "flex" + , Html.Attributes.style "justify-content" "space-evenly" + ] + [ Glue.view single Single.view model + , Glue.view groups Groups.view model + ] diff --git a/experiments/src/Single.elm b/experiments/src/Single.elm new file mode 100644 index 0000000..a130080 --- /dev/null +++ b/experiments/src/Single.elm @@ -0,0 +1,217 @@ +module Single exposing (Model, Msg, init, subscriptions, update, view) + +import Browser +import DnDList +import DnDList.Single +import Html +import Html.Attributes + + + +-- MAIN + + +main : Program () Model Msg +main = + Browser.element + { init = \_ -> init + , view = view + , update = update + , subscriptions = subscriptions + } + + + +-- DATA + + +type alias Item = + String + + +data : List Item +data = + List.range 1 100 |> List.map String.fromInt + + + +-- DND + + +scrollableContainerId : String +scrollableContainerId = + "scrollable-container" + + +system : DnDList.Single.System Item Msg +system = + DnDList.Single.config + |> DnDList.Single.setItemsBeforeReorder (\_ _ list -> list) + |> DnDList.Single.ghost [ "width", "height", "positionTopLeft" ] + |> DnDList.Single.movement DnDList.Free + |> DnDList.Single.listen DnDList.OnDrag + |> DnDList.Single.operation DnDList.Rotate + |> DnDList.Single.detectReorder DetectReorder + |> DnDList.Single.withAutoScroll + --|> DnDList.Single.scroll DnDList.Scroll_Y scrollableContainerId + --|> DnDList.Single.scrollWithOffset { top = 40, right = 0, bottom = 40, left = 0 } DnDList.Scroll_Y scrollableContainerId + |> DnDList.Single.scrollWithOffsetAndWall { top = -40, right = 0, bottom = -40, left = 0 } DnDList.Scroll_Y scrollableContainerId + |> DnDList.Single.create DnDMsg + + + +-- MODEL + + +type alias Model = + { items : List Item + , dnd : DnDList.Single.Model + } + + +initialModel : Model +initialModel = + { items = data + , dnd = system.model + } + + +init : ( Model, Cmd Msg ) +init = + ( initialModel, Cmd.none ) + + + +-- SUBSCRIPTIONS + + +subscriptions : Model -> Sub Msg +subscriptions model = + system.subscriptions model.dnd + + + +-- UPDATE + + +type Msg + = DnDMsg DnDList.Single.Msg + | DetectReorder Int Int (List Item) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + case msg of + DnDMsg dndMsg -> + let + ( items, dndModel, dndCmd ) = + system.update model.items dndMsg model.dnd + in + ( { model | items = items, dnd = dndModel } + , dndCmd + ) + + DetectReorder dragIndex dropIndex fruits -> + -- let + -- _ = + -- Debug.log "DetectReorder" dragIndex + -- _ = + -- Debug.log "DetectReorder" dropIndex + -- _ = + -- Debug.log "DetectReorder" fruits + -- in + ( model, Cmd.none ) + + + +-- VIEW + + +view : Model -> Html.Html Msg +view model = + Html.section + [ Html.Attributes.style "width" "200px" + , Html.Attributes.style "padding" "100px 0" + , if system.info model.dnd /= Nothing then + Html.Attributes.style "cursor" "grabbing" + + else + Html.Attributes.style "cursor" "default" + ] + [ List.range 1 20 + |> List.map (String.fromInt >> (\n -> Html.div [] [ Html.text n ])) + |> Html.div [] + , model.items + |> List.indexedMap (itemView model.dnd) + |> Html.div + [ Html.Attributes.id scrollableContainerId + , Html.Attributes.style "height" "800px" + , Html.Attributes.style "overflow" "auto" + ] + + --, model.items + -- |> List.indexedMap (itemView model.dnd) + -- |> Html.div + -- [ Html.Attributes.id scrollableContainerId + -- , Html.Attributes.style "width" "300px" + -- , Html.Attributes.style "overflow" "auto" + -- , Html.Attributes.style "display" "flex" + -- ] + , ghostView model.dnd model.items + ] + + +itemView : DnDList.Single.Model -> Int -> Item -> Html.Html Msg +itemView dnd index item = + let + itemId : String + itemId = + "single-" ++ item + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.div + (Html.Attributes.id itemId :: itemStyles "#eeeeee" ++ system.dropEvents index itemId) + [ Html.text item ] + + else + Html.div + (Html.Attributes.id itemId :: itemStyles "#bbbbbb") + [ Html.text item ] + + Nothing -> + Html.div + ([ Html.Attributes.id itemId, Html.Attributes.style "cursor" "grab" ] ++ itemStyles "white" ++ system.dragEvents index itemId) + [ Html.text item ] + + +ghostView : DnDList.Single.Model -> List Item -> Html.Html Msg +ghostView dnd items = + let + maybeDragItem : Maybe Item + maybeDragItem = + system.info dnd + |> Maybe.andThen (\{ dragIndex } -> items |> List.drop dragIndex |> List.head) + in + case maybeDragItem of + Just item -> + Html.div + (system.ghostStyles dnd ++ itemStyles "red") + [ Html.text item ] + + Nothing -> + Html.text "" + + + +-- STYLES + + +itemStyles : String -> List (Html.Attribute msg) +itemStyles color = + [ Html.Attributes.style "padding" "1rem" + , Html.Attributes.style "border" "1px solid #bbb" + , Html.Attributes.style "background-color" color + , Html.Attributes.style "box-sizing" "border-box" + ] diff --git a/package.json b/package.json index f0ae024..37c20d1 100755 --- a/package.json +++ b/package.json @@ -1,20 +1,23 @@ -{ - "scripts": { - "watch": "cd examples && elm-live src/Main.elm --pushstate --port=8081 --dir=. --open -- --output=assets/main.js --debug", - "watch:exp": "cd experiments && elm-live src/Main.elm --port=8082 --dir=. --open -- --debug", - "watch:doc": "elm-doc-preview", - "analyse": "cd examples && elm-analyse --serve --port=8083", - "test": "elm-test && npm run build", - "build": "npm run format && rm -rf docs/assets && npm run optimize && (elm diff || true) && cp -a examples/assets docs", - "format": "elm-format --validate .", - "optimize": "cd examples && elm make src/Main.elm --optimize --output=assets/main.js" - }, - "devDependencies": { - "elm": "^0.19.1-3", - "elm-analyse": "^0.16.5", - "elm-doc-preview": "^5.0.2", - "elm-format": "^0.8.3", - "elm-live": "^4.0.2", - "elm-test": "^0.19.1-revision2" - } -} \ No newline at end of file +{ + "scripts": { + "watch:d:elm": "cd examples && elm-live src/Main.elm --pushstate --port=8081 --dir=. --open -- --debug --output=assets/main.js", + "watch:d:sass": "sass --watch examples/scss:examples/assets", + "d": "npm-run-all -p watch:d:*", + "watch:exp": "cd experiments && elm-live src/Main.elm --port=8082 --dir=. --open -- --debug", + "watch:doc": "elm-doc-preview", + "test": "elm-test && npm run format && npm run build", + "build": "rm -rf docs/assets && npm run optimize && (elm diff || true) && cp -a examples/assets docs", + "format": "elm-format --validate .", + "optimize": "cd examples && elm make src/Main.elm --optimize --output=assets/main.js", + "make": "cd experiments && elm make src/Main.elm --output=assets/main-no-opt.js" + }, + "devDependencies": { + "elm": "^0.19.1-3", + "elm-doc-preview": "^5.0.3", + "elm-format": "^0.8.3", + "elm-live": "^4.0.2", + "elm-test": "^0.19.1-revision2", + "npm-run-all": "^4.1.5", + "sass": "^1.26.5" + } +} diff --git a/src/DnDList.elm b/src/DnDList.elm old mode 100755 new mode 100644 index dce1bb2..cf28f6f --- a/src/DnDList.elm +++ b/src/DnDList.elm @@ -1,354 +1,13 @@ -module DnDList exposing - ( System, create, Msg - , Config - , Movement(..), Listen(..), Operation(..) - , Info - , Model - ) +module DnDList exposing (Movement(..), Listen(..), Operation(..), Orientation(..)) -{-| While dragging and dropping a list item, the mouse events, the ghost element's positioning -and the list sorting are handled internally by this module. -Here is a [basic demo](https://annaghi.github.io/dnd-list/introduction/basic), -we will use it as an illustration throughout this page. - -The first step is to create a `System` object which holds all the information related to the drag and drop features. -Using this object you can wire up the module's internal model, subscriptions, commands, and update -into your model, subscriptions, commands, and update respectively. - -Next, when you write your `view` functions, you will need to bind the drag and drop events to the list items, -and also style them according to their current state. -The `System` object gives you access to events and to detailed information about the drag source and drop target items. - -Finally, you will need to render a ghost element to be used for dragging display. -You can add position styling attributes to this element using the`System` object. - -  - - -## Meaningful type aliases - - type alias DragIndex = - Int - - type alias DropIndex = - Int - - type alias DragElementId = - String - - type alias DropElementId = - String - - type alias Position = - { x : Float - , y : Float - } - - -# System - -@docs System, create, Msg +{-| # Config -@docs Config -@docs Movement, Listen, Operation - - -# Info - -@docs Info - - -# System fields - - -## model - -@docs Model - - -## subscriptions - -`subscriptions` is a function to access the browser events during the dragging. - - subscriptions : Model -> Sub Msg - subscriptions model = - system.subscriptions model.dnd - - -## commands - -`commands` is a function to access the DOM for the drag source and the drop target as HTML elements. - - update : Msg -> Model -> ( Model, Cmd Msg ) - update message model = - case message of - MyMsg msg -> - let - updatedModel = ... - in - ( updatedModel - , system.commands updatedModel - ) - - -## update - -`update` is a function which returns an updated internal `Model` and the sorted list for your model. - - update : Msg -> Model -> ( Model, Cmd Msg ) - update message model = - case message of - MyMsg msg -> - let - ( dnd, items ) = - system.update msg model.dnd model.items - in - ( { model | dnd = dnd, items = items } - , system.commands dnd - ) - - -## dragEvents - -`dragEvents` is a function which wraps all the events up for the drag source items. - -This and the following example will show us how to use auxiliary items and think about them in two different ways: - - - as ordinary list items from the list operation point of view, and - - as specially styled elements from the HTML design point of view. - -``` - itemView : DnDList.Model -> Int -> Fruit -> Html.Html Msg - itemView dnd index item = - let - itemId : String - itemId = - "id-" ++ item - in - case system.info dnd of - Just _ -> - -- Render when there is an ongoing dragging. - - Nothing -> - Html.p - (Html.Attributes.id itemId - :: system.dragEvents index itemId - ) - [ Html.text item ] -``` - - -## dropEvents - -`dropEvents` is a function which wraps all the events up for the drop target items. - - itemView : DnDList.Model -> Int -> Fruit -> Html.Html Msg - itemView dnd index item = - let - itemId : String - itemId = - "id-" ++ item - in - case system.info dnd of - Just { dragIndex } -> - if dragIndex /= index then - Html.p - (Html.Attributes.id itemId - :: system.dropEvents index itemId - ) - [ Html.text item ] - - else - Html.p - [ Html.Attributes.id itemId ] - [ Html.text "[---------]" ] - - Nothing -> - -- Render when there is no dragging. - - -## ghostStyles - -`ghostStyles` is a function which wraps up the positioning styles of the ghost element. -The ghost element has absolute position relative to the viewport. - - ghostView : DnDList.Model -> List Fruit -> Html.Html Msg - ghostView dnd items = - let - maybeDragItem : Maybe Fruit - maybeDragItem = - system.info dnd - |> Maybe.andThen - (\{ dragIndex } -> - items - |> List.drop dragIndex - |> List.head - ) - in - case maybeDragItem of - Just item -> - Html.div - (system.ghostStyles dnd) - [ Html.text item ] - - Nothing -> - Html.text "" - -The following CSS will be added: - - { - position: fixed; - left: 0; - top: 0; - transform: translate3d(the vector is calculated from the dragElement and the mouse position in pixels); - height: the dragElement's height in pixels; - width: the dragElement's width in pixels; - pointer-events: none; - } - - -## info - -See [Info](#info). - --} - -import Browser.Dom -import Browser.Events -import Html -import Html.Attributes -import Html.Events -import Internal.Common.Operations -import Internal.Common.Utils -import Json.Decode -import Task - - -{-| Represents the internal model of the current drag and drop features. -It will be `Nothing` if there is no ongoing dragging. -You should set it in your model and initialize through the `System`'s `model` field. - - type alias Model = - { dnd : DnDList.Model - , items : List Fruit - } - - initialModel : Model - initialModel = - { dnd = system.model - , items = data - } - --} -type Model - = Model (Maybe State) - - -type alias State = - { dragIndex : DragIndex - , dropIndex : DropIndex - , dragCounter : Int - , startPosition : Position - , currentPosition : Position - , dragElementId : DragElementId - , dropElementId : DropElementId - , dragElement : Maybe Browser.Dom.Element - , dropElement : Maybe Browser.Dom.Element - } - - -{-| A `System` encapsulates: - - - the internal model, subscriptions, commands, and update, - - - the bindable events and styles, and - - - the `Info` object. - -Later we will learn more about the [Info object](#info) and the [System fields](#system-fields). - --} -type alias System a msg = - { model : Model - , subscriptions : Model -> Sub msg - , commands : Model -> Cmd msg - , update : Msg -> Model -> List a -> ( Model, List a ) - , dragEvents : DragIndex -> DragElementId -> List (Html.Attribute msg) - , dropEvents : DropIndex -> DropElementId -> List (Html.Attribute msg) - , ghostStyles : Model -> List (Html.Attribute msg) - , info : Model -> Maybe Info - } - - -{-| Creates a `System` object according to the configuration. - -Suppose we have a list of fruits: - - type alias Fruit = - String - - data : List Fruit - data = - [ "Apples", "Bananas", "Cherries", "Dates" ] - -Now the `System` is a wrapper type around the list item and our message types: - - system : DnDList.System Fruit Msg - system = - DnDList.create config MyMsg - --} -create : Config a -> (Msg -> msg) -> System a msg -create config stepMsg = - { model = Model Nothing - , subscriptions = subscriptions stepMsg - , commands = commands stepMsg - , update = update config - , dragEvents = dragEvents stepMsg - , dropEvents = dropEvents stepMsg - , ghostStyles = ghostStyles config.movement - , info = info - } - - -{-| Represents the `System`'s configuration. - - - `beforeUpdate`: This is a hook and gives you access to your list before it will be sorted. - The first number is the drag index, the second number is the drop index. - The [Towers of Hanoi](https://annaghi.github.io/dnd-list/gallery/hanoi) uses this hook to update the disks' `tower` attribute. - - - `movement`: The dragging can be constrained to horizontal or vertical axis only, or it can be set to free. - This [demo config](https://annaghi.github.io/dnd-list/config/movement) shows the different movements in action. - - - `listen`: The items can listen for drag events or for drop events. - In the first case the list will be sorted again and again while the mouse moves over the different drop target items. - In the second case the list will be sorted only once on that drop target where the mouse was finally released. - - - `operation`: Different kinds of sort operations can be performed on the list. - You can start to analyze them with - [sorting on drag](https://annaghi.github.io/dnd-list/config/operations-drag) - and [sorting on drop](https://annaghi.github.io/dnd-list/config/operations-drop). - -This is our configuration with a void `beforeUpdate`: - - config : DnDList.Config Fruit - config = - { beforeUpdate = \_ _ list -> list - , movement = DnDList.Free - , listen = DnDList.OnDrag - , operation = DnDList.Rotate - } +@docs Movement, Listen, Operation, Orientation, HasWall -} -type alias Config a = - { beforeUpdate : DragIndex -> DropIndex -> List a -> List a - , movement : Movement - , listen : Listen - , operation : Operation - } {-| Represents the mouse dragging movement. @@ -403,413 +62,7 @@ type Operation | Unaltered -{-| Represents the information about the drag source and the drop target items. -It is accessible through the `System`'s `info` field. - - - `dragIndex`: The index of the drag source. - - - `dropIndex`: The index of the drop target. - - - `dragElementId`: HTML id of the drag source. - - - `dropElementId`: HTML id of the drop target. - - - `dragElement`: Information about the drag source as an HTML element, see `Browser.Dom.Element`. - - - `dropElement`: Information about the drop target as an HTML element, see `Browser.Dom.Element`. - - - `startPosition`: The x, y position of the ghost element when dragging started. - - - `currentPosition`: The x, y position of the ghost element now. - -You can check the `Info` object to decide what to render when there is an ongoing dragging, -and what to render when there is no dragging: - - itemView : DnDList.Model -> Int -> Fruit -> Html.Html Msg - itemView dnd index item = - ... - case system.info dnd of - Just _ -> - -- Render when there is an ongoing dragging. - - Nothing -> - -- Render when there is no dragging. - -Or you can determine the current drag source item using the `Info` object: - - maybeDragItem : DnDList.Model -> List Fruit -> Maybe Fruit - maybeDragItem dnd items = - system.info dnd - |> Maybe.andThen - (\{ dragIndex } -> - items - |> List.drop dragIndex - |> List.head - ) - -Or you can control over generating styles for the dragged ghost element. -For example adding an offset to the position: - - type alias Offset = - { x : Int - , y : Int - } - - customGhostStyle : DnDList.Model -> DnDList.Info -> Offset -> List (Html.Attribute msg) - customGhostStyle dnd { element } offset = - let - px : Int -> String - px x = - String.fromInt x ++ "px" - - translate : Int -> Int -> String - translate x y = - "translate3d(" ++ px x ++ ", " ++ px y ++ ", 0)" - in - case system.info dnd of - Just { currentPosition, startPosition } -> - [ Html.Attribute.style "transform" <| - translate - (round element.x + offset.x) - (round (currentPosition.y - startPosition.y + element.y) + offset.y) - ] - - Nothing -> - [] - --} -type alias Info = - { dragIndex : DragIndex - , dropIndex : DropIndex - , dragElementId : DragElementId - , dropElementId : DropElementId - , dragElement : Browser.Dom.Element - , dropElement : Browser.Dom.Element - , startPosition : Position - , currentPosition : Position - } - - -info : Model -> Maybe Info -info (Model model) = - Maybe.andThen - (\state -> - Maybe.map2 - (\dragElement dropElement -> - { dragIndex = state.dragIndex - , dropIndex = state.dropIndex - , dragElementId = state.dragElementId - , dropElementId = state.dropElementId - , dragElement = dragElement - , dropElement = dropElement - , startPosition = state.startPosition - , currentPosition = state.currentPosition - } - ) - state.dragElement - state.dropElement - ) - model - - -subscriptions : (Msg -> msg) -> Model -> Sub msg -subscriptions stepMsg (Model model) = - case model of - Nothing -> - Sub.none - - Just _ -> - Sub.batch - [ Browser.Events.onMouseMove - (Internal.Common.Utils.decodeCoordinates - |> Json.Decode.map (stepMsg << Drag) - ) - , Browser.Events.onMouseUp - (Json.Decode.succeed (stepMsg DragEnd)) - ] - - -commands : (Msg -> msg) -> Model -> Cmd msg -commands stepMsg (Model model) = - case model of - Nothing -> - Cmd.none - - Just state -> - Cmd.batch - [ dragElementCommands stepMsg state - , dropElementCommands stepMsg state - ] - - -dragElementCommands : (Msg -> msg) -> State -> Cmd msg -dragElementCommands stepMsg state = - case state.dragElement of - Nothing -> - Task.attempt (stepMsg << GotDragElement) (Browser.Dom.getElement state.dragElementId) - - _ -> - Cmd.none - - -dropElementCommands : (Msg -> msg) -> State -> Cmd msg -dropElementCommands stepMsg state = - if state.dragCounter == 0 then - Task.attempt (stepMsg << GotDropElement) (Browser.Dom.getElement state.dropElementId) - - else - Cmd.none - - -{-| Internal message type. -It should be wrapped within our message constructor: - - type Msg - = MyMsg DnDList.Msg - --} -type Msg - = DragStart DragIndex DragElementId Position - | Drag Position - | DragOver DropIndex DropElementId - | DragEnter DropIndex - | DragLeave - | DragEnd - | GotDragElement (Result Browser.Dom.Error Browser.Dom.Element) - | GotDropElement (Result Browser.Dom.Error Browser.Dom.Element) - - -update : Config a -> Msg -> Model -> List a -> ( Model, List a ) -update { beforeUpdate, listen, operation } msg (Model model) list = - case msg of - DragStart dragIndex dragElementId xy -> - ( Model <| - Just - { dragIndex = dragIndex - , dropIndex = dragIndex - , dragCounter = 0 - , startPosition = xy - , currentPosition = xy - , dragElementId = dragElementId - , dropElementId = dragElementId - , dragElement = Nothing - , dropElement = Nothing - } - , list - ) - - Drag xy -> - ( model - |> Maybe.map (\state -> { state | currentPosition = xy, dragCounter = state.dragCounter + 1 }) - |> Model - , list - ) - - DragOver dropIndex dropElementId -> - ( model - |> Maybe.map (\state -> { state | dropIndex = dropIndex, dropElementId = dropElementId }) - |> Model - , list - ) - - DragEnter dropIndex -> - case ( model, listen ) of - ( Just state, OnDrag ) -> - if state.dragCounter > 1 && state.dragIndex /= dropIndex then - ( Model (Just (stateUpdate operation dropIndex state)) - , list - |> beforeUpdate state.dragIndex dropIndex - |> listUpdate operation state.dragIndex dropIndex - ) - - else - ( Model model, list ) - - _ -> - ( model - |> Maybe.map (\state -> { state | dragCounter = 0 }) - |> Model - , list - ) - - DragLeave -> - ( model - |> Maybe.map (\state -> { state | dropIndex = state.dragIndex }) - |> Model - , list - ) - - DragEnd -> - case ( model, listen ) of - ( Just state, OnDrop ) -> - if state.dragIndex /= state.dropIndex then - ( Model Nothing - , list - |> beforeUpdate state.dragIndex state.dropIndex - |> listUpdate operation state.dragIndex state.dropIndex - ) - - else - ( Model Nothing, list ) - - _ -> - ( Model Nothing, list ) - - GotDragElement (Err _) -> - ( Model model, list ) - - GotDragElement (Ok dragElement) -> - ( model - |> Maybe.map (\state -> { state | dragElement = Just dragElement, dropElement = Just dragElement }) - |> Model - , list - ) - - GotDropElement (Err _) -> - ( Model model, list ) - - GotDropElement (Ok dropElement) -> - ( model - |> Maybe.map (\state -> { state | dropElement = Just dropElement }) - |> Model - , list - ) - - -stateUpdate : Operation -> DropIndex -> State -> State -stateUpdate operation dropIndex state = - case operation of - InsertAfter -> - { state - | dragIndex = - if dropIndex < state.dragIndex then - dropIndex + 1 - - else - dropIndex - , dragCounter = 0 - } - - InsertBefore -> - { state - | dragIndex = - if state.dragIndex < dropIndex then - dropIndex - 1 - - else - dropIndex - , dragCounter = 0 - } - - Rotate -> - { state | dragIndex = dropIndex, dragCounter = 0 } - - Swap -> - { state | dragIndex = dropIndex, dragCounter = 0 } - - Unaltered -> - { state | dragCounter = 0 } - - -listUpdate : Operation -> DragIndex -> DropIndex -> List a -> List a -listUpdate operation dragIndex dropIndex list = - case operation of - InsertAfter -> - Internal.Common.Operations.insertAfter dragIndex dropIndex list - - InsertBefore -> - Internal.Common.Operations.insertBefore dragIndex dropIndex list - - Rotate -> - Internal.Common.Operations.rotate dragIndex dropIndex list - - Swap -> - Internal.Common.Operations.swap dragIndex dropIndex list - - Unaltered -> - list - - -dragEvents : (Msg -> msg) -> DragIndex -> DragElementId -> List (Html.Attribute msg) -dragEvents stepMsg dragIndex dragElementId = - [ Html.Events.preventDefaultOn "mousedown" - (Internal.Common.Utils.decodeCoordinatesWithButtonCheck - |> Json.Decode.map (stepMsg << DragStart dragIndex dragElementId) - |> Json.Decode.map (\msg -> ( msg, True )) - ) - ] - - -dropEvents : (Msg -> msg) -> DropIndex -> DropElementId -> List (Html.Attribute msg) -dropEvents stepMsg dropIndex dropElementId = - [ Html.Events.onMouseOver (stepMsg (DragOver dropIndex dropElementId)) - , Html.Events.onMouseEnter (stepMsg (DragEnter dropIndex)) - , Html.Events.onMouseLeave (stepMsg DragLeave) - ] - - -ghostStyles : Movement -> Model -> List (Html.Attribute msg) -ghostStyles movement (Model model) = - case model of - Nothing -> - [] - - Just state -> - case state.dragElement of - Just { element } -> - let - baseStyles = - [ Html.Attributes.style "position" "fixed" - , Html.Attributes.style "top" "0" - , Html.Attributes.style "left" "0" - , Html.Attributes.style "height" (Internal.Common.Utils.px (round element.height)) - , Html.Attributes.style "width" (Internal.Common.Utils.px (round element.width)) - , Html.Attributes.style "pointer-events" "none" - ] - - transform = - case movement of - Horizontal -> - Html.Attributes.style "transform" <| - Internal.Common.Utils.translate - (round (state.currentPosition.x - state.startPosition.x + element.x)) - (round element.y) - - Vertical -> - Html.Attributes.style "transform" <| - Internal.Common.Utils.translate - (round element.x) - (round (state.currentPosition.y - state.startPosition.y + element.y)) - - Free -> - Html.Attributes.style "transform" <| - Internal.Common.Utils.translate - (round (state.currentPosition.x - state.startPosition.x + element.x)) - (round (state.currentPosition.y - state.startPosition.y + element.y)) - in - transform :: baseStyles - - _ -> - [] - - -type alias DragIndex = - Int - - -type alias DropIndex = - Int - - -type alias DragElementId = - String - - -type alias DropElementId = - String - - -type alias Position = - { x : Float - , y : Float - } +type Orientation + = Scroll_X + | Scroll_Y + | Scroll_XY diff --git a/src/DnDList/Groups.elm b/src/DnDList/Groups.elm index 9404c96..69a2151 100644 --- a/src/DnDList/Groups.elm +++ b/src/DnDList/Groups.elm @@ -1,9 +1,11 @@ module DnDList.Groups exposing - ( System, create, Msg - , Config - , Listen(..), Operation(..) - , Info + ( Config, config + , listen, operation, ghost, groups + , setItemsBeforeReorder + , detectDrop, detectReorder + , System, create, Msg , Model + , Info ) {-| If the list is groupable by a certain property, the items can be transferred between those groups. @@ -12,7 +14,7 @@ and possibly prepared with auxiliary items. Here is a [demo with groups](https://annaghi.github.io/dnd-list/introduction/groups), we will use it as an illustration throughout this page. -This module is a modified version of the `DnDList` module. +This module is a modified version of the `Single` module. The `Config` was extended with a new field called `groups`, and the `movement` field was withdrawn. With groupable items the drag source and the drop target items can belong to the _same group_ or to _different groups_. @@ -44,15 +46,22 @@ So now the internal sorting distinguishes between these two cases and we need to } +# Config + +@docs Config, config +@docs listen, operation, ghost, groups +@docs setItemsBeforeReorder +@docs detectDrop, detectReorder + + # System @docs System, create, Msg -# Config +## Model -@docs Config -@docs Listen, Operation +@docs Model # Info @@ -63,11 +72,6 @@ So now the internal sorting distinguishes between these two cases and we need to # System fields -## model - -@docs Model - - ## subscriptions `subscriptions` is a function to access the browser events during the dragging. @@ -209,7 +213,7 @@ itemView model offset localIndex { group, value, color } = `ghostStyles` is a function which wraps up the positioning styles of the ghost element. The ghost element has absolute position relative to the viewport. - ghostView : DnDList.Groups.Model -> List Item -> Html.Html Msg + ghostView : Single.Groups.Model -> List Item -> Html.Html Msg ghostView dnd items = case maybeDragItem dnd items of Just { value, color } -> @@ -241,49 +245,158 @@ See [Info](#info). import Browser.Dom import Browser.Events +import DnDList exposing (..) import Html import Html.Attributes import Html.Events -import Internal.Common.Operations -import Internal.Common.Utils +import Internal.Decoders +import Internal.Ghost import Internal.Groups +import Internal.Operations +import Internal.Types exposing (..) import Json.Decode import Task -{-| Represents the internal model of the current drag and drop features. -It will be `Nothing` if there is no ongoing dragging. -You should set it in your model and initialize through the `System`'s `model` field. +{-| Represents the `System`'s configuration. - type alias Model = - { dnd : DnDList.Groups.Model - , items : List Item - } + - `beforeUpdate`: This is a hook and gives you access to your list before it will be sorted. + The first number is the drag index, the second number is the drop index. + The [Towers of Hanoi](https://annaghi.github.io/dnd-list/gallery/hanoi) uses this hook to update the disks' `tower` property. - initialModel : Model - initialModel = - { dnd = system.model - , items = preparedData + - `listen`: This setting is for the operation performing on the _same group_. + The items can listen for drag events or for drop events. + In the first case the list will be sorted again and again while the mouse moves over the different drop target items. + In the second case the list will be sorted only once on that drop target where the mouse was finally released. + + - `operation`: This setting is for the operation performing on the _same group_. + Different kinds of sort operations can be performed on the list. + You can start to analyze them with + [sorting on drag](https://annaghi.github.io/dnd-list/config/operations-drag) + and [sorting on drop](https://annaghi.github.io/dnd-list/config/operations-drop). + + - `groups`: This setting is for the operation performing on _different groups_, + when the drag source and the drop target belong to different groups. + To have a better understanding of how this works + see [sorting between groups on drag](https://annaghi.github.io/dnd-list/config-groups/operations-drag) + and [sorting between groups on drop](https://annaghi.github.io/dnd-list/config-groups/operations-drop). + - `listen`: Same as the plain `listen` but applied when transferring items between groups. + - `operation`: Same as the plain `operation` but applied when transferring items between groups. + - `comparator`: You should provide this function, which determines if two items are from different groups. + - `setter`: You should provide this function, which updates the second item's group by the first item's group. + +This is our configuration with a void `beforeUpdate`: + + config : Single.Groups.Config Item + config = + { beforeUpdate = \_ _ list -> list + , listen = Single.Groups.OnDrag + , operation = Single.Groups.Rotate + , groups = + { listen = Single.Groups.OnDrag + , operation = Single.Groups.InsertBefore + , comparator = comparator + , setter = setter + } } + comparator : Item -> Item -> Bool + comparator item1 item2 = + item1.group == item2.group + + setter : Item -> Item -> Item + setter item1 item2 = + { item2 | group = item1.group } + -} -type Model - = Model (Maybe State) +type Config item msg + = Config (Options item msg) -type alias State = - { dragIndex : DragIndex - , dropIndex : DropIndex - , dragCounter : Int - , startPosition : Position - , currentPosition : Position - , dragElementId : DragElementId - , dropElementId : DropElementId - , dragElement : Maybe Browser.Dom.Element - , dropElement : Maybe Browser.Dom.Element +type alias Options item msg = + { listen : Listen + , operation : Operation + , ghost : List String + , setItemsBeforeReorder : DragIndex -> DropIndex -> List item -> List item + , detectDrop : Maybe (DragIndex -> DropIndex -> List item -> msg) + , detectReorder : Maybe (DragIndex -> DropIndex -> List item -> msg) + , groups : + { listen : Listen + , operation : Operation + , comparator : item -> item -> Bool + , setter : item -> item -> item + } + } + + +config : Config item msg +config = + Config defaultOptions + + +defaultOptions : Options item msg +defaultOptions = + { listen = OnDrag + , operation = Rotate + , ghost = [ "width", "height", "positionTopLeft" ] + , setItemsBeforeReorder = \_ _ list -> list + , detectDrop = Nothing + , detectReorder = Nothing + , groups = + { listen = OnDrag + , operation = InsertBefore + , comparator = \_ _ -> True + , setter = \_ item -> item + } } + +-- Options + + +listen : Listen -> Config item msg -> Config item msg +listen listen_ (Config options) = + Config { options | listen = listen_ } + + +operation : Operation -> Config item msg -> Config item msg +operation operation_ (Config options) = + Config { options | operation = operation_ } + + +ghost : List String -> Config item msg -> Config item msg +ghost properties (Config options) = + Config { options | ghost = properties } + + +groups : + { listen : Listen + , operation : Operation + , comparator : item -> item -> Bool + , setter : item -> item -> item + } + -> Config item msg + -> Config item msg +groups properties (Config options) = + Config { options | groups = properties } + + +setItemsBeforeReorder : (DragIndex -> DropIndex -> List item -> List item) -> Config item msg -> Config item msg +setItemsBeforeReorder hook (Config options) = + Config { options | setItemsBeforeReorder = hook } + + +detectDrop : (DragIndex -> DropIndex -> List item -> msg) -> Config item msg -> Config item msg +detectDrop toMessage (Config options) = + Config { options | detectDrop = Just toMessage } + + +detectReorder : (DragIndex -> DropIndex -> List item -> msg) -> Config item msg -> Config item msg +detectReorder toMessage (Config options) = + Config { options | detectReorder = Just toMessage } + + {-| A `System` encapsulates: - the internal model, subscriptions, commands, and update, @@ -295,11 +408,10 @@ type alias State = Later we will learn more about the [Info object](#info) and the [System fields](#system-fields). -} -type alias System a msg = +type alias System item msg = { model : Model , subscriptions : Model -> Sub msg - , commands : Model -> Cmd msg - , update : Msg -> Model -> List a -> ( Model, List a ) + , update : List item -> Msg -> Model -> ( List item, Model, Cmd msg ) , dragEvents : DragIndex -> DragElementId -> List (Html.Attribute msg) , dropEvents : DropIndex -> DropElementId -> List (Html.Attribute msg) , ghostStyles : Model -> List (Html.Attribute msg) @@ -345,122 +457,55 @@ The sort operations were designed with the following list state invariant in min And now the `System` is a wrapper type around the list item and our message types: - system : DnDList.Groups.System Item Msg + system : Single.Groups.System Item Msg system = - DnDList.Groups.create config MyMsg + Single.Groups.create config MyMsg -} -create : Config a -> (Msg -> msg) -> System a msg -create config stepMsg = +create : (Msg -> msg) -> Config item msg -> System item msg +create toMsg configuration = { model = Model Nothing - , subscriptions = subscriptions stepMsg - , commands = commands stepMsg - , update = update config - , dragEvents = dragEvents stepMsg - , dropEvents = dropEvents stepMsg - , ghostStyles = ghostStyles + , subscriptions = subscriptions toMsg + , update = update configuration toMsg + , dragEvents = dragEvents toMsg + , dropEvents = dropEvents toMsg + , ghostStyles = ghostStyles configuration , info = info } -{-| Represents the `System`'s configuration. - - - `beforeUpdate`: This is a hook and gives you access to your list before it will be sorted. - The first number is the drag index, the second number is the drop index. - The [Towers of Hanoi](https://annaghi.github.io/dnd-list/gallery/hanoi) uses this hook to update the disks' `tower` property. - - - `listen`: This setting is for the operation performing on the _same group_. - The items can listen for drag events or for drop events. - In the first case the list will be sorted again and again while the mouse moves over the different drop target items. - In the second case the list will be sorted only once on that drop target where the mouse was finally released. - - - `operation`: This setting is for the operation performing on the _same group_. - Different kinds of sort operations can be performed on the list. - You can start to analyze them with - [sorting on drag](https://annaghi.github.io/dnd-list/config/operations-drag) - and [sorting on drop](https://annaghi.github.io/dnd-list/config/operations-drop). - - - `groups`: This setting is for the operation performing on _different groups_, - when the drag source and the drop target belong to different groups. - To have a better understanding of how this works - see [sorting between groups on drag](https://annaghi.github.io/dnd-list/config-groups/operations-drag) - and [sorting between groups on drop](https://annaghi.github.io/dnd-list/config-groups/operations-drop). - - `listen`: Same as the plain `listen` but applied when transferring items between groups. - - `operation`: Same as the plain `operation` but applied when transferring items between groups. - - `comparator`: You should provide this function, which determines if two items are from different groups. - - `setter`: You should provide this function, which updates the second item's group by the first item's group. - -This is our configuration with a void `beforeUpdate`: +{-| Represents the internal model of the current drag and drop features. +It will be `Nothing` if there is no ongoing dragging. +You should set it in your model and initialize through the `System`'s `model` field. - config : DnDList.Groups.Config Item - config = - { beforeUpdate = \_ _ list -> list - , listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.Rotate - , groups = - { listen = DnDList.Groups.OnDrag - , operation = DnDList.Groups.InsertBefore - , comparator = comparator - , setter = setter - } + type alias Model = + { dnd : Single.Groups.Model + , items : List Item } - comparator : Item -> Item -> Bool - comparator item1 item2 = - item1.group == item2.group - - setter : Item -> Item -> Item - setter item1 item2 = - { item2 | group = item1.group } - --} -type alias Config a = - { beforeUpdate : DragIndex -> DropIndex -> List a -> List a - , listen : Listen - , operation : Operation - , groups : - { listen : Listen - , operation : Operation - , comparator : a -> a -> Bool - , setter : a -> a -> a + initialModel : Model + initialModel = + { dnd = system.model + , items = preparedData } - } - - -{-| Represents the event for which the list sorting is available. - - - `OnDrag`: The list will be sorted when the ghost element is being dragged over a drop target item. - - - `OnDrop`: The list will be sorted when the ghost element is dropped on a drop target item. -} -type Listen - = OnDrag - | OnDrop - - -{-| Represents the list sort operation. -Detailed comparisons can be found here: -[sorting on drag](https://annaghi.github.io/dnd-list/config/operations-drag) -and [sorting on drop](https://annaghi.github.io/dnd-list/config/operations-drop). - - - `InsertAfter`: The drag source item will be inserted after the drop target item. - - - `InsertBefore`: The drag source item will be inserted before the drop target item. - - - `Rotate`: The items between the drag source and the drop target items will be circularly shifted. - - - `Swap`: The drag source and the drop target items will be swapped. +type Model + = Model (Maybe State) - - `Unaltered`: The list items will keep their initial order. --} -type Operation - = InsertAfter - | InsertBefore - | Rotate - | Swap - | Unaltered +type alias State = + { dragIndex : DragIndex + , dropIndex : DropIndex + , moveCounter : Int + , startPosition : Coordinates + , currentPosition : Coordinates + , translateVector : Coordinates + , dragElementId : DragElementId + , dropElementId : DropElementId + , dragElement : Maybe Browser.Dom.Element + , dropElement : Maybe Browser.Dom.Element + } {-| Represents the information about the drag source and the drop target items. @@ -497,7 +542,7 @@ and what to render when there is no dragging: Or you can determine the current drag source item using the `Info` object: - maybeDragItem : DnDList.Groups.Model -> List Item -> Maybe Item + maybeDragItem : Single.Groups.Model -> List Item -> Maybe Item maybeDragItem dnd items = system.info dnd |> Maybe.andThen @@ -507,36 +552,6 @@ Or you can determine the current drag source item using the `Info` object: |> List.head ) -Or you can control over generating styles for the dragged ghost element. -For example adding an offset to the position: - - type alias Offset = - { x : Int - , y : Int - } - - customGhostStyle : DnDList.Model -> DnDList.Info -> Offset -> List (Html.Attribute msg) - customGhostStyle dnd { element } offset = - let - px : Int -> String - px x = - String.fromInt x ++ "px" - - translate : Int -> Int -> String - translate x y = - "translate3d(" ++ px x ++ ", " ++ px y ++ ", 0)" - in - case system.info dnd of - Just { currentPosition, startPosition } -> - [ Html.Attribute.style "transform" <| - translate - (round element.x + offset.x) - (round (currentPosition.y - startPosition.y + element.y) + offset.y) - ] - - Nothing -> - [] - -} type alias Info = { dragIndex : DragIndex @@ -545,228 +560,258 @@ type alias Info = , dropElementId : DropElementId , dragElement : Browser.Dom.Element , dropElement : Browser.Dom.Element - , startPosition : Position - , currentPosition : Position } info : Model -> Maybe Info info (Model model) = - Maybe.andThen - (\state -> - Maybe.map2 - (\dragElement dropElement -> - { dragIndex = state.dragIndex - , dropIndex = state.dropIndex - , dragElementId = state.dragElementId - , dropElementId = state.dropElementId - , dragElement = dragElement - , dropElement = dropElement - , startPosition = state.startPosition - , currentPosition = state.currentPosition - } - ) - state.dragElement - state.dropElement - ) - model - - -subscriptions : (Msg -> msg) -> Model -> Sub msg -subscriptions stepMsg (Model model) = case model of - Nothing -> - Sub.none - - Just _ -> - Sub.batch - [ Browser.Events.onMouseMove - (Internal.Common.Utils.decodeCoordinates - |> Json.Decode.map (stepMsg << Drag) - ) - , Browser.Events.onMouseUp - (Json.Decode.succeed (stepMsg DragEnd)) - ] + Just state -> + case ( state.dragElement, state.dropElement ) of + ( Just dragElement, Just dropElement ) -> + Just + { dragIndex = state.dragIndex + , dropIndex = state.dropIndex + , dragElementId = state.dragElementId + , dropElementId = state.dropElementId + , dragElement = dragElement + , dropElement = dropElement + } + _ -> + Nothing -commands : (Msg -> msg) -> Model -> Cmd msg -commands stepMsg (Model model) = - case model of Nothing -> - Cmd.none + Nothing - Just state -> - Cmd.batch - [ dragElementCommands stepMsg state - , dropElementCommands stepMsg state - ] +{-| Internal message type. +It should be wrapped within our message constructor: -dragElementCommands : (Msg -> msg) -> State -> Cmd msg -dragElementCommands stepMsg state = - case state.dragElement of - Nothing -> - Task.attempt (stepMsg << GotDragElement) (Browser.Dom.getElement state.dragElementId) + type Msg + = MyMsg Single.Groups.Msg - _ -> - Cmd.none +-} +type Msg + = DownInsideDragItem DragIndex DragElementId Coordinates + | InBetweenMsg InBetweenMsg + | ReleaseMouse -dropElementCommands : (Msg -> msg) -> State -> Cmd msg -dropElementCommands stepMsg state = - if state.dragCounter == 0 then - Task.attempt (stepMsg << GotDropElement) (Browser.Dom.getElement state.dropElementId) +type InBetweenMsg + = MoveMouse Coordinates + | OverDropItem DropIndex DropElementId + | EnterDropItem + | LeaveDropItem + | GetDragItem (Result Browser.Dom.Error Browser.Dom.Element) + | GetDropItem (Result Browser.Dom.Error Browser.Dom.Element) + | Tick Float - else - Cmd.none +subscriptions : (Msg -> msg) -> Model -> Sub msg +subscriptions toMsg (Model model) = + if model /= Nothing then + Sub.batch + [ Browser.Events.onMouseMove + (Internal.Decoders.decodeCoordinates |> Json.Decode.map (MoveMouse >> InBetweenMsg >> toMsg)) + , Browser.Events.onMouseUp + (Json.Decode.succeed (ReleaseMouse |> toMsg)) + , Browser.Events.onAnimationFrameDelta (Tick >> InBetweenMsg >> toMsg) + ] -{-| Internal message type. -It should be wrapped within our message constructor: + else + Sub.none - type Msg - = MyMsg DnDList.Groups.Msg --} -type Msg - = DragStart DragIndex DragElementId Position - | Drag Position - | DragOver DropIndex DropElementId - | DragEnter DropIndex - | DragLeave - | DragEnd - | GotDragElement (Result Browser.Dom.Error Browser.Dom.Element) - | GotDropElement (Result Browser.Dom.Error Browser.Dom.Element) - - -update : Config a -> Msg -> Model -> List a -> ( Model, List a ) -update { beforeUpdate, listen, operation, groups } msg (Model model) list = +update : Config item msg -> (Msg -> msg) -> List item -> Msg -> Model -> ( List item, Model, Cmd msg ) +update (Config options) toMsg list msg (Model model) = case msg of - DragStart dragIndex dragElementId xy -> - ( Model <| + DownInsideDragItem dragIndex dragElementId coordinates -> + ( list + , Model <| Just { dragIndex = dragIndex , dropIndex = dragIndex - , dragCounter = 0 - , startPosition = xy - , currentPosition = xy + , moveCounter = 0 + , startPosition = coordinates + , currentPosition = coordinates + , translateVector = Coordinates 0 0 , dragElementId = dragElementId , dropElementId = dragElementId , dragElement = Nothing , dropElement = Nothing } - , list + , Cmd.none ) - Drag xy -> - ( model - |> Maybe.map (\state -> { state | currentPosition = xy, dragCounter = state.dragCounter + 1 }) - |> Model - , list - ) + InBetweenMsg inBetweenMsg -> + case model of + Just state -> + let + ( newList, newState, newCmd ) = + inBetweenUpdate options toMsg list inBetweenMsg state + in + ( newList, Model (Just newState), newCmd ) - DragOver dropIndex dropElementId -> - ( model - |> Maybe.map (\state -> { state | dropIndex = dropIndex, dropElementId = dropElementId }) - |> Model - , list - ) + Nothing -> + ( list, Model Nothing, Cmd.none ) - DragEnter dropIndex -> + ReleaseMouse -> + -- TODO This branch should be DRY case model of Just state -> - if state.dragCounter > 1 && state.dragIndex /= dropIndex then + if state.dragIndex /= state.dropIndex then let equalGroups : Bool equalGroups = - Internal.Groups.equalGroups groups.comparator state.dragIndex dropIndex list + Internal.Groups.equalGroups options.groups.comparator state.dragIndex state.dropIndex list in - if listen == OnDrag && equalGroups then - ( Model (Just (stateUpdate operation dropIndex state)) - , list - |> beforeUpdate state.dragIndex dropIndex - |> sublistUpdate operation state.dragIndex dropIndex + if options.listen == OnDrop && equalGroups then + let + -- TODO I do not like creating variable from the list + newList : List item + newList = + list + |> options.setItemsBeforeReorder state.dragIndex state.dropIndex + |> groupUpdate options.operation state.dragIndex state.dropIndex + in + ( newList + , Model Nothing + , options.detectDrop + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed newList)) + |> Maybe.withDefault Cmd.none ) - else if groups.listen == OnDrag && not equalGroups then - ( Model (Just (stateUpdate groups.operation dropIndex state)) - , list - |> beforeUpdate state.dragIndex dropIndex - |> listUpdate groups.operation groups.comparator groups.setter state.dragIndex dropIndex + else if options.groups.listen == OnDrop && not equalGroups then + let + newList : List item + newList = + list + |> options.setItemsBeforeReorder state.dragIndex state.dropIndex + |> listUpdate options.groups.operation options.groups.comparator options.groups.setter state.dragIndex state.dropIndex + in + ( newList + , Model Nothing + , options.detectDrop + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed newList)) + |> Maybe.withDefault Cmd.none ) else - ( Model (Just { state | dragCounter = 0 }), list ) + ( list + , Model Nothing + , options.detectDrop + |> Maybe.map (\f -> Task.perform (f state.dragIndex state.dropIndex) (Task.succeed list)) + |> Maybe.withDefault Cmd.none + ) else - ( Model model, list ) + ( list + , Model Nothing + , options.detectDrop + |> Maybe.map (\f -> Task.perform (f state.dragIndex state.dropIndex) (Task.succeed list)) + |> Maybe.withDefault Cmd.none + ) _ -> - ( Model model, list ) + ( list, Model Nothing, Cmd.none ) + - DragLeave -> - ( model - |> Maybe.map (\state -> { state | dropIndex = state.dragIndex }) - |> Model - , list +inBetweenUpdate : Options item msg -> (Msg -> msg) -> List item -> InBetweenMsg -> State -> ( List item, State, Cmd msg ) +inBetweenUpdate options toMsg list msg state = + case msg of + MoveMouse coordinates -> + ( list + , { state | currentPosition = coordinates, moveCounter = state.moveCounter + 1 } + , if state.dragElement == Nothing then + Cmd.map (InBetweenMsg >> toMsg) (Task.attempt GetDragItem (Browser.Dom.getElement state.dragElementId)) + + else + Cmd.none ) - DragEnd -> - case model of - Just state -> - if state.dragIndex /= state.dropIndex then - let - equalGroups : Bool - equalGroups = - Internal.Groups.equalGroups groups.comparator state.dragIndex state.dropIndex list - in - if listen == OnDrop && equalGroups then - ( Model Nothing - , list - |> beforeUpdate state.dragIndex state.dropIndex - |> sublistUpdate operation state.dragIndex state.dropIndex - ) + OverDropItem dropIndex dropElementId -> + ( list + , { state | dropIndex = dropIndex, dropElementId = dropElementId } + , Cmd.map (InBetweenMsg >> toMsg) (Task.attempt GetDropItem (Browser.Dom.getElement dropElementId)) + ) - else if groups.listen == OnDrop && not equalGroups then - ( Model Nothing - , list - |> beforeUpdate state.dragIndex state.dropIndex - |> listUpdate groups.operation groups.comparator groups.setter state.dragIndex state.dropIndex - ) + EnterDropItem -> + if state.moveCounter > 1 && state.dragIndex /= state.dropIndex then + let + equalGroups : Bool + equalGroups = + Internal.Groups.equalGroups options.groups.comparator state.dragIndex state.dropIndex list + in + if options.listen == OnDrag && equalGroups then + let + newList : List item + newList = + list + |> options.setItemsBeforeReorder state.dragIndex state.dropIndex + |> groupUpdate options.operation state.dragIndex state.dropIndex + in + ( newList + , stateUpdate options.operation state.dropIndex state + , options.detectReorder + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed newList)) + |> Maybe.withDefault Cmd.none + ) - else - ( Model Nothing, list ) + else if options.groups.listen == OnDrag && not equalGroups then + let + newList : List item + newList = + list + |> options.setItemsBeforeReorder state.dragIndex state.dropIndex + |> listUpdate options.groups.operation options.groups.comparator options.groups.setter state.dragIndex state.dropIndex + in + ( newList + , stateUpdate options.groups.operation state.dropIndex state + , options.detectReorder + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed newList)) + |> Maybe.withDefault Cmd.none + ) - else - ( Model Nothing, list ) + else + ( list, { state | moveCounter = 0 }, Cmd.none ) - _ -> - ( Model Nothing, list ) + else + ( list, state, Cmd.none ) - GotDragElement (Err _) -> - ( Model model, list ) + LeaveDropItem -> + ( list + , { state | dropIndex = state.dragIndex } + , Cmd.none + ) - GotDragElement (Ok dragElement) -> - ( model - |> Maybe.map (\state -> { state | dragElement = Just dragElement, dropElement = Just dragElement }) - |> Model - , list + GetDragItem result -> + ( list + , { state | dragElement = Result.toMaybe result, dropElement = Result.toMaybe result } + , Cmd.none ) - GotDropElement (Err _) -> - ( Model model, list ) + GetDropItem result -> + ( list + , { state | dropElement = Result.toMaybe result } + , Cmd.none + ) - GotDropElement (Ok dropElement) -> - ( model - |> Maybe.map (\state -> { state | dropElement = Just dropElement }) - |> Model - , list + Tick _ -> + ( list + , { state + | translateVector = + Coordinates + (state.currentPosition.x - state.startPosition.x) + (state.currentPosition.y - state.startPosition.y) + } + , Cmd.none ) stateUpdate : Operation -> DropIndex -> State -> State -stateUpdate operation dropIndex state = - case operation of +stateUpdate operation_ dropIndex state = + case operation_ of InsertAfter -> { state | dragIndex = @@ -775,7 +820,7 @@ stateUpdate operation dropIndex state = else dropIndex - , dragCounter = 0 + , moveCounter = 0 } InsertBefore -> @@ -786,61 +831,61 @@ stateUpdate operation dropIndex state = else dropIndex - , dragCounter = 0 + , moveCounter = 0 } Rotate -> - { state | dragIndex = dropIndex, dragCounter = 0 } + { state | dragIndex = dropIndex, moveCounter = 0 } Swap -> - { state | dragIndex = dropIndex, dragCounter = 0 } + { state | dragIndex = dropIndex, moveCounter = 0 } Unaltered -> - { state | dragCounter = 0 } + { state | moveCounter = 0 } -sublistUpdate : Operation -> DragIndex -> DropIndex -> List a -> List a -sublistUpdate operation dragIndex dropIndex list = - case operation of +groupUpdate : Operation -> DragIndex -> DropIndex -> List item -> List item +groupUpdate operation_ dragIndex dropIndex list = + case operation_ of InsertAfter -> - Internal.Common.Operations.insertAfter dragIndex dropIndex list + Internal.Operations.insertAfter dragIndex dropIndex list InsertBefore -> - Internal.Common.Operations.insertBefore dragIndex dropIndex list + Internal.Operations.insertBefore dragIndex dropIndex list Rotate -> - Internal.Common.Operations.rotate dragIndex dropIndex list + Internal.Operations.rotate dragIndex dropIndex list Swap -> - Internal.Common.Operations.swap dragIndex dropIndex list + Internal.Operations.swap dragIndex dropIndex list Unaltered -> list -listUpdate : Operation -> (a -> a -> Bool) -> (a -> a -> a) -> DragIndex -> DropIndex -> List a -> List a -listUpdate operation comparator setter dragIndex dropIndex list = - case operation of +listUpdate : Operation -> (item -> item -> Bool) -> (item -> item -> item) -> DragIndex -> DropIndex -> List item -> List item +listUpdate operation_ comparator setter dragIndex dropIndex list = + case operation_ of InsertAfter -> list |> Internal.Groups.dragGroupUpdate setter dragIndex dropIndex - |> Internal.Common.Operations.insertAfter dragIndex dropIndex + |> Internal.Operations.insertAfter dragIndex dropIndex InsertBefore -> list |> Internal.Groups.dragGroupUpdate setter dragIndex dropIndex - |> Internal.Common.Operations.insertBefore dragIndex dropIndex + |> Internal.Operations.insertBefore dragIndex dropIndex Rotate -> if dragIndex < dropIndex then list |> Internal.Groups.allGroupUpdate (List.reverse >> Internal.Groups.bubbleGroupRecursive comparator setter >> List.reverse) dragIndex dropIndex - |> Internal.Common.Operations.rotate dragIndex dropIndex + |> Internal.Operations.rotate dragIndex dropIndex else if dropIndex < dragIndex then list |> Internal.Groups.allGroupUpdate (Internal.Groups.bubbleGroupRecursive comparator setter) dropIndex dragIndex - |> Internal.Common.Operations.rotate dragIndex dropIndex + |> Internal.Operations.rotate dragIndex dropIndex else list @@ -848,72 +893,57 @@ listUpdate operation comparator setter dragIndex dropIndex list = Swap -> list |> Internal.Groups.dragAndDropGroupUpdate setter dragIndex dropIndex - |> Internal.Common.Operations.swap dragIndex dropIndex + |> Internal.Operations.swap dragIndex dropIndex Unaltered -> list + +-- EVENTS + + dragEvents : (Msg -> msg) -> DragIndex -> DragElementId -> List (Html.Attribute msg) -dragEvents stepMsg dragIndex dragElementId = +dragEvents toMsg dragIndex dragElementId = [ Html.Events.preventDefaultOn "mousedown" - (Internal.Common.Utils.decodeCoordinatesWithButtonCheck - |> Json.Decode.map (stepMsg << DragStart dragIndex dragElementId) + (Internal.Decoders.decodeCoordinatesWithButtonCheck + |> Json.Decode.map (DownInsideDragItem dragIndex dragElementId >> toMsg) |> Json.Decode.map (\msg -> ( msg, True )) ) ] dropEvents : (Msg -> msg) -> DropIndex -> DropElementId -> List (Html.Attribute msg) -dropEvents stepMsg dropIndex dropElementId = - [ Html.Events.onMouseOver (stepMsg (DragOver dropIndex dropElementId)) - , Html.Events.onMouseEnter (stepMsg (DragEnter dropIndex)) - , Html.Events.onMouseLeave (stepMsg DragLeave) +dropEvents toMsg dropIndex dropElementId = + [ Html.Events.onMouseOver (OverDropItem dropIndex dropElementId |> InBetweenMsg |> toMsg) + , Html.Events.onMouseEnter (EnterDropItem |> InBetweenMsg |> toMsg) + , Html.Events.onMouseLeave (LeaveDropItem |> InBetweenMsg |> toMsg) ] -ghostStyles : Model -> List (Html.Attribute msg) -ghostStyles (Model model) = - case model of - Nothing -> - [] +-- STYLES + + +ghostStyles : Config item msg -> Model -> List (Html.Attribute msg) +ghostStyles (Config options) (Model model) = + case model of Just state -> case state.dragElement of - Just { element } -> - [ Html.Attributes.style "position" "fixed" - , Html.Attributes.style "left" "0" - , Html.Attributes.style "top" "0" - , Html.Attributes.style "transform" <| - Internal.Common.Utils.translate - (round (state.currentPosition.x - state.startPosition.x + element.x)) - (round (state.currentPosition.y - state.startPosition.y + element.y)) - , Html.Attributes.style "height" (Internal.Common.Utils.px (round element.height)) - , Html.Attributes.style "width" (Internal.Common.Utils.px (round element.width)) - , Html.Attributes.style "pointer-events" "none" - ] + Just dragElement -> + transformDeclaration state.translateVector dragElement + :: Internal.Ghost.baseDeclarations options.ghost dragElement _ -> [] - -type alias DragIndex = - Int - - -type alias DropIndex = - Int - - -type alias DragElementId = - String - - -type alias DropElementId = - String + Nothing -> + [] -type alias Position = - { x : Float - , y : Float - } +transformDeclaration : Coordinates -> Browser.Dom.Element -> Html.Attribute msg +transformDeclaration { x, y } { element, viewport } = + Html.Attributes.style "transform" <| + Internal.Ghost.translate + (round (x + element.x - viewport.x)) + (round (y + element.y - viewport.y)) diff --git a/src/DnDList/Single.elm b/src/DnDList/Single.elm new file mode 100755 index 0000000..d3f414f --- /dev/null +++ b/src/DnDList/Single.elm @@ -0,0 +1,946 @@ +module DnDList.Single exposing + ( Config, config + , movement, listen, operation, ghost + , setItemsBeforeReorder + , detectDrop, detectReorder + , withAutoScroll + , scroll, scrollWithOffset, scrollWithOffsetAndWall + , System, create, Msg + , Model + , Info + ) + +{-| While dragging and dropping a list item, the mouse events, the ghost element's positioning +and the list sorting are handled internally by this module. +Here is a [basic demo](https://annaghi.github.io/dnd-list/introduction/basic), +we will use it as an illustration throughout this page. + +The first step is to create a `System` object which holds all the information related to the drag and drop features. +Using this object you can wire up the module's internal model, subscriptions, commands, and update +into your model, subscriptions, commands, and update respectively. + +Next, when you write your `view` functions, you will need to bind the drag and drop events to the list items, +and also style them according to their current state. +The `System` object gives you access to events and to detailed information about the drag source and drop target items. + +Finally, you will need to render a ghost element to be used for dragging display. +You can add position styling attributes to this element using the`System` object. + +  + + +## Meaningful type aliases + + type alias DragIndex = + Int + + type alias DropIndex = + Int + + type alias DragElementId = + String + + type alias DropElementId = + String + + type alias Position = + { x : Float + , y : Float + } + + +# Config + +@docs Config, config +@docs movement, listen, operation, ghost +@docs setItemsBeforeReorder +@docs detectDrop, detectReorder +@docs withAutoScroll +@docs scroll, scrollWithOffset, scrollWithOffsetAndWall + + +# System + +@docs System, create, Msg + + +## Model + +@docs Model + + +# Info + +@docs Info + + +# System fields + + +## subscriptions + +`subscriptions` is a function to access the browser events during the dragging. + + subscriptions : Model -> Sub Msg + subscriptions model = + system.subscriptions model.dnd + + +## commands + +`commands` is a function to access the DOM for the drag source and the drop target as HTML elements. + + update : Msg -> Model -> ( Model, Cmd Msg ) + update message model = + case message of + MyMsg msg -> + let + updatedModel = ... + in + ( updatedModel + , system.commands updatedModel + ) + + +## update + +`update` is a function which returns an updated internal `Model` and the sorted list for your model. + + update : Msg -> Model -> ( Model, Cmd Msg ) + update message model = + case message of + MyMsg msg -> + let + ( dnd, items ) = + system.update msg model.dnd model.items + in + ( { model | dnd = dnd, items = items } + , system.commands dnd + ) + + +## dragEvents + +`dragEvents` is a function which wraps all the events up for the drag source items. + +This and the following example will show us how to use auxiliary items and think about them in two different ways: + + - as ordinary list items from the list operation point of view, and + - as specially styled elements from the HTML design point of view. + +``` + itemView : Single.Model -> Int -> Fruit -> Html.Html Msg + itemView dnd index item = + let + itemId : String + itemId = + "id-" ++ item + in + case system.info dnd of + Just _ -> + -- Render when there is an ongoing dragging. + + Nothing -> + Html.p + (Html.Attributes.id itemId + :: system.dragEvents index itemId + ) + [ Html.text item ] +``` + + +## dropEvents + +`dropEvents` is a function which wraps all the events up for the drop target items. + + itemView : Single.Model -> Int -> Fruit -> Html.Html Msg + itemView dnd index item = + let + itemId : String + itemId = + "id-" ++ item + in + case system.info dnd of + Just { dragIndex } -> + if dragIndex /= index then + Html.p + (Html.Attributes.id itemId + :: system.dropEvents index itemId + ) + [ Html.text item ] + + else + Html.p + [ Html.Attributes.id itemId ] + [ Html.text "[---------]" ] + + Nothing -> + -- Render when there is no dragging. + + +## ghostStyles + +`ghostStyles` is a function which wraps up the positioning styles of the ghost element. +The ghost element has absolute position relative to the viewport. + + ghostView : Single.Model -> List Fruit -> Html.Html Msg + ghostView dnd items = + let + maybeDragItem : Maybe Fruit + maybeDragItem = + system.info dnd + |> Maybe.andThen + (\{ dragIndex } -> + items + |> List.drop dragIndex + |> List.head + ) + in + case maybeDragItem of + Just item -> + Html.div + (system.ghostStyles dnd) + [ Html.text item ] + + Nothing -> + Html.text "" + +The following CSS will be added: + + { + position: fixed; + left: 0; + top: 0; + transform: translate3d(the vector is calculated from the dragElement and the mouse position in pixels); + height: the dragElement's height in pixels; + width: the dragElement's width in pixels; + pointer-events: none; + } + + +## info + +See [Info](#info). + +-} + +import Browser.Dom +import Browser.Events +import DnDList exposing (..) +import Html +import Html.Attributes +import Html.Events +import Internal.Decoders +import Internal.Ghost +import Internal.Operations +import Internal.Scroll +import Internal.Types exposing (..) +import Json.Decode +import Task + + +{-| Represents the `System`'s configuration. + + - `setItemsBeforeReorder`: This is a hook and gives you access to your list before it will be sorted. + The first number is the drag index, the second number is the drop index. + The [Towers of Hanoi](https://annaghi.github.io/dnd-list/gallery/hanoi) uses this hook to update the disks' `tower` attribute. + + - `movement`: The dragging can be constrained to horizontal or vertical axis only, or it can be set to free. + This [demo config](https://annaghi.github.io/dnd-list/config/movement) shows the different movements in action. + + - `listen`: The items can listen for drag events or for drop events. + In the first case the list will be sorted again and again while the mouse moves over the different drop target items. + In the second case the list will be sorted only once on that drop target where the mouse was finally released. + + - `operation`: Different kinds of sort operations can be performed on the list. + You can start to analyze them with + [sorting on drag](https://annaghi.github.io/dnd-list/config/operations-drag) + and [sorting on drop](https://annaghi.github.io/dnd-list/config/operations-drop). + +This is our configuration with a void `setItemsBeforeReorder`: + + config : Single.Config Fruit + config = + { setItemsBeforeReorder = \_ _ list -> list + , movement = Single.Free + , listen = Single.OnDrag + , operation = Single.Rotate + } + +-} +type Config item msg + = Config (Options item msg) + + +type alias Options item msg = + { movement : Movement + , listen : Listen + , operation : Operation + , ghost : List String + , setItemsBeforeReorder : DragIndex -> DropIndex -> List item -> List item + , detectDrop : Maybe (DragIndex -> DropIndex -> List item -> msg) + , detectReorder : Maybe (DragIndex -> DropIndex -> List item -> msg) + , autoScroll : Bool + , scroll : Maybe ScrollOptions + } + + +config : Config item msg +config = + Config defaultOptions + + +defaultOptions : Options item msg +defaultOptions = + { movement = Free + , listen = OnDrag + , operation = Rotate + , ghost = [ "width", "height", "positionTopLeft" ] + , setItemsBeforeReorder = \_ _ list -> list + , detectDrop = Nothing + , detectReorder = Nothing + , autoScroll = False + , scroll = Nothing + } + + + +-- Options + + +movement : Movement -> Config item msg -> Config item msg +movement movement_ (Config options) = + Config { options | movement = movement_ } + + +listen : Listen -> Config item msg -> Config item msg +listen listen_ (Config options) = + Config { options | listen = listen_ } + + +operation : Operation -> Config item msg -> Config item msg +operation operation_ (Config options) = + Config { options | operation = operation_ } + + +ghost : List String -> Config item msg -> Config item msg +ghost properties (Config options) = + Config { options | ghost = properties } + + +setItemsBeforeReorder : (DragIndex -> DropIndex -> List item -> List item) -> Config item msg -> Config item msg +setItemsBeforeReorder hook (Config options) = + Config { options | setItemsBeforeReorder = hook } + + +detectDrop : (DragIndex -> DropIndex -> List item -> msg) -> Config item msg -> Config item msg +detectDrop toMessage (Config options) = + Config { options | detectDrop = Just toMessage } + + +detectReorder : (DragIndex -> DropIndex -> List item -> msg) -> Config item msg -> Config item msg +detectReorder toMessage (Config options) = + Config { options | detectReorder = Just toMessage } + + +withAutoScroll : Config item msg -> Config item msg +withAutoScroll (Config options) = + Config { options | autoScroll = True } + + +scroll : Orientation -> ContainerElementId -> Config item msg -> Config item msg +scroll orientation containerElementId (Config options) = + Config + { options + | scroll = + Just + { containerElementId = containerElementId + , orientation = orientation + , offset = Internal.Scroll.noOffset + , hasWall = False + } + } + + +scrollWithOffset : Offset -> Orientation -> ContainerElementId -> Config item msg -> Config item msg +scrollWithOffset offset orientation containerElementId (Config options) = + Config + { options + | scroll = + Just + { containerElementId = containerElementId + , orientation = orientation + , offset = offset + , hasWall = False + } + } + + +scrollWithOffsetAndWall : Offset -> Orientation -> ContainerElementId -> Config item msg -> Config item msg +scrollWithOffsetAndWall offset orientation containerElementId (Config options) = + Config + { options + | scroll = + Just + { containerElementId = containerElementId + , orientation = orientation + , offset = offset + , hasWall = True + } + } + + +{-| A `System` encapsulates: + + - the internal model, subscriptions, commands, and update, + + - the bindable events and styles, and + + - the `Info` object. + +Later we will learn more about the [Info object](#info) and the [System fields](#system-fields). + +-} +type alias System item msg = + { model : Model + , subscriptions : Model -> Sub msg + , update : List item -> Msg -> Model -> ( List item, Model, Cmd msg ) + , dragEvents : DragIndex -> DragElementId -> List (Html.Attribute msg) + , dropEvents : DropIndex -> DropElementId -> List (Html.Attribute msg) + , ghostStyles : Model -> List (Html.Attribute msg) + , info : Model -> Maybe Info + } + + +{-| Creates a `System` object according to the configuration. + +Suppose we have a list of fruits: + + type alias Fruit = + String + + data : List Fruit + data = + [ "Apples", "Bananas", "Cherries", "Dates" ] + +Now the `System` is a wrapper type around the list item and our message types: + + system : Single.System Fruit Msg + system = + Single.create config MyMsg + +-} +create : (Msg -> msg) -> Config item msg -> System item msg +create toMsg configuration = + { model = Model Nothing + , subscriptions = subscriptions toMsg + , update = update configuration toMsg + , dragEvents = dragEvents toMsg + , dropEvents = dropEvents toMsg + , ghostStyles = ghostStyles configuration + , info = info + } + + +{-| Represents the internal model of the current drag and drop features. +It will be `Nothing` if there is no ongoing dragging. +You should set it in your model and initialize through the `System`'s `model` field. + + type alias Model = + { dnd : Single.Model + , items : List Fruit + } + + initialModel : Model + initialModel = + { dnd = system.model + , items = data + } + +-} +type Model + = Model (Maybe State) + + +type alias State = + { dragIndex : DragIndex + , dropIndex : DropIndex + , moveCounter : Int + , startPosition : Coordinates + , currentPosition : Coordinates + , translateVector : Coordinates + , dragElementId : DragElementId + , dropElementId : DropElementId + , dragElement : Maybe Browser.Dom.Element + , dropElement : Maybe Browser.Dom.Element + , containerElement : Maybe Browser.Dom.Element + } + + +{-| Represents the information about the drag source and the drop target items. +It is accessible through the `System`'s `info` field. + + - `dragIndex`: The index of the drag source. + + - `dropIndex`: The index of the drop target. + + - `dragElementId`: HTML id of the drag source. + + - `dropElementId`: HTML id of the drop target. + + - `dragElement`: Information about the drag source as an HTML element, see `Browser.Dom.Element`. + + - `dropElement`: Information about the drop target as an HTML element, see `Browser.Dom.Element`. + + - `startPosition`: The x, y position of the ghost element when dragging started. + + - `currentPosition`: The x, y position of the ghost element now. + +You can check the `Info` object to decide what to render when there is an ongoing dragging, +and what to render when there is no dragging: + + itemView : Single.Model -> Int -> Fruit -> Html.Html Msg + itemView dnd index item = + ... + case system.info dnd of + Just _ -> + -- Render when there is an ongoing dragging. + + Nothing -> + -- Render when there is no dragging. + +Or you can determine the current drag source item using the `Info` object: + + maybeDragItem : Single.Model -> List Fruit -> Maybe Fruit + maybeDragItem dnd items = + system.info dnd + |> Maybe.andThen + (\{ dragIndex } -> + items + |> List.drop dragIndex + |> List.head + ) + +-} +type alias Info = + { dragIndex : DragIndex + , dropIndex : DropIndex + , dragElementId : DragElementId + , dropElementId : DropElementId + , dragElement : Browser.Dom.Element + , dropElement : Browser.Dom.Element + } + + +info : Model -> Maybe Info +info (Model model) = + case model of + Just state -> + case ( state.dragElement, state.dropElement ) of + ( Just dragElement, Just dropElement ) -> + Just + { dragIndex = state.dragIndex + , dropIndex = state.dropIndex + , dragElementId = state.dragElementId + , dropElementId = state.dropElementId + , dragElement = dragElement + , dropElement = dropElement + } + + _ -> + Nothing + + Nothing -> + Nothing + + +{-| Internal message type. +It should be wrapped within our message constructor: + + type Msg + = MyMsg Single.Msg + +-} +type Msg + = DownInsideDragItem DragIndex DragElementId Coordinates + | InBetweenMsg InBetweenMsg + | ReleaseMouse + + +type InBetweenMsg + = MoveMouse Coordinates + | OverDropItem DropIndex DropElementId + | EnterDropItem + | LeaveDropItem + | GetDragItem (Result Browser.Dom.Error Browser.Dom.Element) + | GetDropItem (Result Browser.Dom.Error Browser.Dom.Element) + | GetContainer (Result Browser.Dom.Error Browser.Dom.Element) + | TickMsg TickMsg + + +type TickMsg + = Tick Float + | ScrollOnContainer (Result Browser.Dom.Error Internal.Scroll.ScrollMeta) + | AutoScrollOnContainer (Result Browser.Dom.Error Internal.Scroll.ScrollMeta) + | NoOp + + +subscriptions : (Msg -> msg) -> Model -> Sub msg +subscriptions toMsg (Model model) = + if model /= Nothing then + Sub.batch + [ Browser.Events.onMouseMove + (Internal.Decoders.decodeCoordinates |> Json.Decode.map (MoveMouse >> InBetweenMsg >> toMsg)) + , Browser.Events.onMouseUp + (Json.Decode.succeed (ReleaseMouse |> toMsg)) + , Browser.Events.onAnimationFrameDelta (Tick >> TickMsg >> InBetweenMsg >> toMsg) + ] + + else + Sub.none + + +update : Config item msg -> (Msg -> msg) -> List item -> Msg -> Model -> ( List item, Model, Cmd msg ) +update (Config options) toMsg list msg (Model model) = + case msg of + DownInsideDragItem dragIndex dragElementId coordinates -> + ( list + , Model <| + Just + { dragIndex = dragIndex + , dropIndex = dragIndex + , moveCounter = 0 + , startPosition = coordinates + , currentPosition = coordinates + , translateVector = Coordinates 0 0 + , dragElementId = dragElementId + , dropElementId = dragElementId + , dragElement = Nothing + , dropElement = Nothing + , containerElement = Nothing + } + , Cmd.batch + [ Cmd.map (InBetweenMsg >> toMsg) (Task.attempt GetDragItem (Browser.Dom.getElement dragElementId)) + , case options.scroll of + Just scrollOptions -> + Cmd.map (InBetweenMsg >> toMsg) (Task.attempt GetContainer (Browser.Dom.getElement scrollOptions.containerElementId)) + + Nothing -> + Cmd.none + ] + ) + + InBetweenMsg inBetweenMsg -> + case model of + Just state -> + let + ( newList, newState, newCmd ) = + inBetweenUpdate options toMsg list inBetweenMsg state + in + ( newList, Model (Just newState), newCmd ) + + Nothing -> + ( list, Model Nothing, Cmd.none ) + + ReleaseMouse -> + -- TODO This branch might be DRY + case model of + Just state -> + if state.dragIndex /= state.dropIndex then + if options.listen == OnDrop then + let + -- TODO Is there a way to get rid of this newList variable? + newList : List item + newList = + list + |> options.setItemsBeforeReorder state.dragIndex state.dropIndex + |> listUpdate options.operation state.dragIndex state.dropIndex + in + ( newList + , Model Nothing + , options.detectDrop + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed newList)) + |> Maybe.withDefault Cmd.none + ) + + else + ( list + , Model Nothing + , options.detectDrop + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed list)) + |> Maybe.withDefault Cmd.none + ) + + else + ( list + , Model Nothing + , options.detectDrop + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed list)) + |> Maybe.withDefault Cmd.none + ) + + _ -> + ( list, Model Nothing, Cmd.none ) + + +inBetweenUpdate : Options item msg -> (Msg -> msg) -> List item -> InBetweenMsg -> State -> ( List item, State, Cmd msg ) +inBetweenUpdate options toMsg list msg state = + case msg of + MoveMouse coordinates -> + ( list + , { state | currentPosition = coordinates, moveCounter = state.moveCounter + 1 } + , Cmd.none + ) + + OverDropItem dropIndex dropElementId -> + ( list + , { state | dropIndex = dropIndex, dropElementId = dropElementId } + , Cmd.map (InBetweenMsg >> toMsg) (Task.attempt GetDropItem (Browser.Dom.getElement dropElementId)) + ) + + EnterDropItem -> + if state.moveCounter > 1 && state.dragIndex /= state.dropIndex then + case options.listen of + OnDrag -> + let + newList : List item + newList = + list + |> options.setItemsBeforeReorder state.dragIndex state.dropIndex + |> listUpdate options.operation state.dragIndex state.dropIndex + in + ( newList + , stateUpdate options.operation state.dropIndex state + , options.detectReorder + |> Maybe.map (\toMessage -> Task.perform (toMessage state.dragIndex state.dropIndex) (Task.succeed newList)) + |> Maybe.withDefault Cmd.none + ) + + OnDrop -> + ( list, { state | moveCounter = 0 }, Cmd.none ) + + else + ( list, state, Cmd.none ) + + LeaveDropItem -> + ( list + , { state | dropIndex = state.dragIndex } + , Cmd.none + ) + + GetDragItem result -> + ( list + , { state | dragElement = Result.toMaybe result, dropElement = Result.toMaybe result } + , Cmd.none + ) + + GetDropItem result -> + ( list + , { state | dropElement = Result.toMaybe result } + , Cmd.none + ) + + GetContainer result -> + ( list + , { state | containerElement = Result.toMaybe result } + , Cmd.none + ) + + TickMsg tickMsg -> + let + ( newState, newCmd ) = + tickUpdate options tickMsg state + in + ( list, newState, Cmd.map (TickMsg >> InBetweenMsg >> toMsg) newCmd ) + + +tickUpdate : Options item msg -> TickMsg -> State -> ( State, Cmd TickMsg ) +tickUpdate options msg state = + case msg of + Tick _ -> + case ( options.autoScroll, options.scroll ) of + ( True, Just scrollOptions ) -> + case state.containerElement of + Just containerElement -> + ( state + , Task.map2 (Internal.Scroll.ScrollMeta scrollOptions containerElement) + (Browser.Dom.getViewportOf scrollOptions.containerElementId) + Browser.Dom.getViewport + |> Task.attempt AutoScrollOnContainer + ) + + Nothing -> + ( { state | translateVector = Internal.Scroll.baseCoordinates state.startPosition state.currentPosition } + , Browser.Dom.getViewport + |> Task.andThen (\documentViewport -> Internal.Scroll.scrollOnDocumentByStep 35 state.currentPosition documentViewport) + |> Task.attempt (\_ -> NoOp) + ) + + ( True, Nothing ) -> + ( { state | translateVector = Internal.Scroll.baseCoordinates state.startPosition state.currentPosition } + , Browser.Dom.getViewport + |> Task.andThen (\documentViewport -> Internal.Scroll.scrollOnDocumentByStep 35 state.currentPosition documentViewport) + |> Task.attempt (\_ -> NoOp) + ) + + ( False, Just scrollOptions ) -> + case state.containerElement of + Just containerElement -> + ( state + , Task.map2 (Internal.Scroll.ScrollMeta scrollOptions containerElement) + (Browser.Dom.getViewportOf scrollOptions.containerElementId) + Browser.Dom.getViewport + |> Task.attempt ScrollOnContainer + ) + + Nothing -> + ( { state | translateVector = Internal.Scroll.baseCoordinates state.startPosition state.currentPosition } + , Cmd.none + ) + + ( False, Nothing ) -> + ( { state | translateVector = Internal.Scroll.baseCoordinates state.startPosition state.currentPosition } + , Cmd.none + ) + + AutoScrollOnContainer (Ok scrollMeta) -> + ( { state | translateVector = Internal.Scroll.coordinates state.startPosition state.currentPosition scrollMeta } + , [ Internal.Scroll.scrollOnDocumentByStep 35 state.currentPosition scrollMeta.documentViewport + , Internal.Scroll.scrollOnContainerByStep 35 state.currentPosition scrollMeta + ] + |> Task.sequence + |> Task.attempt (\_ -> NoOp) + ) + + ScrollOnContainer (Ok scrollMeta) -> + ( { state | translateVector = Internal.Scroll.coordinates state.startPosition state.currentPosition scrollMeta } + , Internal.Scroll.scrollOnContainerByStep 35 state.currentPosition scrollMeta + |> Task.attempt (\_ -> NoOp) + ) + + AutoScrollOnContainer (Err _) -> + ( state, Cmd.none ) + + ScrollOnContainer (Err _) -> + ( state, Cmd.none ) + + NoOp -> + ( state, Cmd.none ) + + +stateUpdate : Operation -> DropIndex -> State -> State +stateUpdate operation_ dropIndex state = + case operation_ of + InsertAfter -> + { state + | dragIndex = + if dropIndex < state.dragIndex then + dropIndex + 1 + + else + dropIndex + , moveCounter = 0 + } + + InsertBefore -> + { state + | dragIndex = + if state.dragIndex < dropIndex then + dropIndex - 1 + + else + dropIndex + , moveCounter = 0 + } + + Rotate -> + { state | dragIndex = dropIndex, moveCounter = 0 } + + Swap -> + { state | dragIndex = dropIndex, moveCounter = 0 } + + Unaltered -> + { state | moveCounter = 0 } + + +listUpdate : Operation -> DragIndex -> DropIndex -> List item -> List item +listUpdate operation_ dragIndex dropIndex list = + case operation_ of + InsertAfter -> + Internal.Operations.insertAfter dragIndex dropIndex list + + InsertBefore -> + Internal.Operations.insertBefore dragIndex dropIndex list + + Rotate -> + Internal.Operations.rotate dragIndex dropIndex list + + Swap -> + Internal.Operations.swap dragIndex dropIndex list + + Unaltered -> + list + + + +-- EVENTS + + +dragEvents : (Msg -> msg) -> DragIndex -> DragElementId -> List (Html.Attribute msg) +dragEvents toMsg dragIndex dragElementId = + [ Html.Events.preventDefaultOn "mousedown" + (Internal.Decoders.decodeCoordinatesWithButtonCheck + |> Json.Decode.map (DownInsideDragItem dragIndex dragElementId >> toMsg) + |> Json.Decode.map (\msg -> ( msg, True )) + ) + ] + + +dropEvents : (Msg -> msg) -> DropIndex -> DropElementId -> List (Html.Attribute msg) +dropEvents toMsg dropIndex dropElementId = + [ Html.Events.onMouseOver (OverDropItem dropIndex dropElementId |> InBetweenMsg |> toMsg) + , Html.Events.onMouseEnter (EnterDropItem |> InBetweenMsg |> toMsg) + , Html.Events.onMouseLeave (LeaveDropItem |> InBetweenMsg |> toMsg) + ] + + + +-- STYLES + + +ghostStyles : Config item msg -> Model -> List (Html.Attribute msg) +ghostStyles (Config options) (Model model) = + case model of + Just state -> + case state.dragElement of + Just dragElement -> + transformDeclaration options.movement state.translateVector dragElement + :: Internal.Ghost.baseDeclarations options.ghost dragElement + + _ -> + [] + + Nothing -> + [] + + +transformDeclaration : Movement -> Coordinates -> Browser.Dom.Element -> Html.Attribute msg +transformDeclaration movement_ { x, y } { element, viewport } = + case movement_ of + Horizontal -> + Html.Attributes.style "transform" <| + Internal.Ghost.translate + (round (x + element.x - viewport.x)) + (round (element.y - viewport.y)) + + Vertical -> + Html.Attributes.style "transform" <| + Internal.Ghost.translate + (round (element.x - viewport.x)) + (round (y + element.y - viewport.y)) + + Free -> + Html.Attributes.style "transform" <| + Internal.Ghost.translate + (round (x + element.x - viewport.x)) + (round (y + element.y - viewport.y)) diff --git a/src/Internal/Common/Utils.elm b/src/Internal/Common/Utils.elm deleted file mode 100755 index 1571a20..0000000 --- a/src/Internal/Common/Utils.elm +++ /dev/null @@ -1,52 +0,0 @@ -module Internal.Common.Utils exposing (decodeCoordinates, decodeCoordinatesWithButtonCheck, px, translate) - -import Json.Decode - - -type alias Position = - { x : Float - , y : Float - } - - -decodeCoordinatesWithButtonCheck : Json.Decode.Decoder Position -decodeCoordinatesWithButtonCheck = - decodeMainMouseButton decodeCoordinates - - -decodeCoordinates : Json.Decode.Decoder Position -decodeCoordinates = - Json.Decode.map2 Position pageX pageY - - -decodeMainMouseButton : Json.Decode.Decoder a -> Json.Decode.Decoder a -decodeMainMouseButton decoder = - Json.Decode.field "button" Json.Decode.int - |> Json.Decode.andThen - (\button -> - if button == 0 then - decoder - - else - Json.Decode.fail "Event is only relevant when the main mouse button was pressed." - ) - - -pageX : Json.Decode.Decoder Float -pageX = - Json.Decode.field "pageX" Json.Decode.float - - -pageY : Json.Decode.Decoder Float -pageY = - Json.Decode.field "pageY" Json.Decode.float - - -translate : Int -> Int -> String -translate x y = - "translate3d(" ++ px x ++ ", " ++ px y ++ ", 0)" - - -px : Int -> String -px n = - String.fromInt n ++ "px" diff --git a/src/Internal/Decoders.elm b/src/Internal/Decoders.elm new file mode 100755 index 0000000..742818e --- /dev/null +++ b/src/Internal/Decoders.elm @@ -0,0 +1,37 @@ +module Internal.Decoders exposing (decodeCoordinates, decodeCoordinatesWithButtonCheck) + +import Internal.Types exposing (Coordinates) +import Json.Decode + + +decodeCoordinatesWithButtonCheck : Json.Decode.Decoder Coordinates +decodeCoordinatesWithButtonCheck = + decodeMainMouseButton decodeCoordinates + + +decodeCoordinates : Json.Decode.Decoder Coordinates +decodeCoordinates = + Json.Decode.map2 Coordinates clientX clientY + + +decodeMainMouseButton : Json.Decode.Decoder a -> Json.Decode.Decoder a +decodeMainMouseButton decoder = + Json.Decode.field "button" Json.Decode.int + |> Json.Decode.andThen + (\button -> + if button == 0 then + decoder + + else + Json.Decode.fail "Event is only relevant when the main mouse button was pressed." + ) + + +clientX : Json.Decode.Decoder Float +clientX = + Json.Decode.field "clientX" Json.Decode.float + + +clientY : Json.Decode.Decoder Float +clientY = + Json.Decode.field "clientY" Json.Decode.float diff --git a/src/Internal/Ghost.elm b/src/Internal/Ghost.elm new file mode 100644 index 0000000..4b50522 --- /dev/null +++ b/src/Internal/Ghost.elm @@ -0,0 +1,53 @@ +module Internal.Ghost exposing (baseDeclarations, translate) + +import Browser.Dom +import Dict +import Html +import Html.Attributes + + +type Property + = Width + | Height + | Position + + +type alias Styles msg = + -- TODO Find a nice and simple way to use Property as key + -- TODO Should properties contain `pointer-events`? + Dict.Dict String (List (Html.Attribute msg)) + + +declarations : Browser.Dom.Element -> Styles msg +declarations { element } = + Dict.fromList + [ ( "width", [ Html.Attributes.style "width" <| px (round element.width) ] ) + , ( "height", [ Html.Attributes.style "height" <| px (round element.height) ] ) + , ( "positionTopLeft" + , [ Html.Attributes.style "position" "fixed" + , Html.Attributes.style "top" "0" + , Html.Attributes.style "left" "0" + ] + ) + ] + + +baseDeclarations : List String -> Browser.Dom.Element -> List (Html.Attribute msg) +baseDeclarations properties element = + Html.Attributes.style "pointer-events" "none" + :: List.foldl (\property acc -> appendDeclarations element property ++ acc) [] properties + + +appendDeclarations : Browser.Dom.Element -> String -> List (Html.Attribute msg) +appendDeclarations element property = + declarations element |> Dict.get property |> Maybe.withDefault [] + + +translate : Int -> Int -> String +translate x y = + "translate3d(" ++ px x ++ ", " ++ px y ++ ", 0)" + + +px : Int -> String +px n = + String.fromInt n ++ "px" diff --git a/src/Internal/Groups.elm b/src/Internal/Groups.elm index 47c598e..5f9f060 100644 --- a/src/Internal/Groups.elm +++ b/src/Internal/Groups.elm @@ -98,7 +98,7 @@ bubbleGroupRecursive comparator setter list = let sublist : List a sublist = - sublistByFirstItem comparator list + groupByFirstItem comparator list in if sublist /= [] then (sublist |> List.drop 1 |> List.reverse) @@ -163,8 +163,8 @@ drops dropIndex list = list |> List.drop dropIndex |> List.take 1 -sublistByFirstItem : (a -> a -> Bool) -> List a -> List a -sublistByFirstItem comparator list = +groupByFirstItem : (a -> a -> Bool) -> List a -> List a +groupByFirstItem comparator list = case list of [] -> [] diff --git a/src/Internal/Common/Operations.elm b/src/Internal/Operations.elm similarity index 98% rename from src/Internal/Common/Operations.elm rename to src/Internal/Operations.elm index bd55864..af444be 100755 --- a/src/Internal/Common/Operations.elm +++ b/src/Internal/Operations.elm @@ -1,4 +1,4 @@ -module Internal.Common.Operations exposing +module Internal.Operations exposing ( insertAfter , insertBefore , rotate diff --git a/src/Internal/Scroll.elm b/src/Internal/Scroll.elm new file mode 100644 index 0000000..cfd0401 --- /dev/null +++ b/src/Internal/Scroll.elm @@ -0,0 +1,220 @@ +module Internal.Scroll exposing (ScrollMeta, baseCoordinates, coordinates, noOffset, scrollOnContainerByStep, scrollOnDocumentByStep) + +import Browser.Dom +import Internal.Types exposing (..) +import Task + + +type Direction + = Bottom + | Right + | Top + | Left + | BottomLeft + | BottomRight + | TopRight + | TopLeft + | None + + +type alias Dimensions = + { x : Float + , y : Float + , width : Float + , height : Float + } + + +type alias ScrollMeta = + { scrollOptions : ScrollOptions + , containerElement : Browser.Dom.Element + , containerViewport : Browser.Dom.Viewport + , documentViewport : Browser.Dom.Viewport + } + + + +-- CONSTANTS + + +noOffset : Offset +noOffset = + { top = 0, right = 0, bottom = 0, left = 0 } + + +documentOffset : Offset +documentOffset = + { top = -10, right = -10, bottom = -10, left = -10 } + + + +-- SCROLL ON DOCUMENT + + +scrollOnDocumentByStep : Float -> Coordinates -> Browser.Dom.Viewport -> Task.Task Browser.Dom.Error () +scrollOnDocumentByStep step currentPosition documentViewport = + case directionDocument documentOffset currentPosition documentViewport of + Bottom -> + Browser.Dom.setViewport documentViewport.viewport.x (documentViewport.viewport.y + step) + + Right -> + Browser.Dom.setViewport (documentViewport.viewport.x + step) documentViewport.viewport.y + + Top -> + Browser.Dom.setViewport documentViewport.viewport.x (documentViewport.viewport.y - step) + + Left -> + Browser.Dom.setViewport (documentViewport.viewport.x - step) documentViewport.viewport.y + + _ -> + Task.succeed () + + +directionDocument : Offset -> Coordinates -> Browser.Dom.Viewport -> Direction +directionDocument offset position { viewport } = + if position.x < -offset.left && position.y > viewport.height + offset.bottom then + BottomLeft + + else if position.x > viewport.width + offset.right && position.y > viewport.height + offset.bottom then + BottomRight + + else if position.x > viewport.width + offset.right && position.y < -offset.top then + TopRight + + else if position.x < -offset.left && position.y < -offset.top then + TopLeft + + else if position.y > viewport.height + offset.bottom then + Bottom + + else if position.x > viewport.width + offset.right then + Right + + else if position.y < -offset.top then + Top + + else if position.x < -offset.left then + Left + + else + None + + + +-- SCROLL ON CONTAINER + + +scrollOnContainerByStep : Float -> Coordinates -> ScrollMeta -> Task.Task Browser.Dom.Error () +scrollOnContainerByStep step currentPosition { scrollOptions, containerElement, containerViewport, documentViewport } = + case direction currentPosition scrollOptions.offset containerElement containerViewport.viewport documentViewport.viewport of + Bottom -> + Browser.Dom.setViewportOf scrollOptions.containerElementId containerViewport.viewport.x (containerViewport.viewport.y + step) + + Right -> + Browser.Dom.setViewportOf scrollOptions.containerElementId (containerViewport.viewport.x + step) containerViewport.viewport.y + + Top -> + Browser.Dom.setViewportOf scrollOptions.containerElementId containerViewport.viewport.x (containerViewport.viewport.y - step) + + Left -> + Browser.Dom.setViewportOf scrollOptions.containerElementId (containerViewport.viewport.x - step) containerViewport.viewport.y + + _ -> + Task.succeed () + + +direction : Coordinates -> Offset -> Browser.Dom.Element -> Dimensions -> Dimensions -> Direction +direction position offset containerElement elementViewport documentViewport = + if position.x < containerElement.element.x - documentViewport.x - offset.left && position.y > containerElement.element.y - documentViewport.y + elementViewport.height + offset.bottom then + BottomLeft + + else if position.x > containerElement.element.x - documentViewport.x + elementViewport.width + offset.right && position.y > containerElement.element.y - documentViewport.y + elementViewport.height + offset.bottom then + BottomRight + + else if position.x > containerElement.element.x - documentViewport.x + elementViewport.width + offset.right && position.y < containerElement.element.y - documentViewport.y - offset.top then + TopRight + + else if position.x < containerElement.element.x - documentViewport.x - offset.left && position.y < containerElement.element.y - documentViewport.y - offset.top then + TopLeft + + else if position.y > containerElement.element.y - documentViewport.y + elementViewport.height + offset.bottom then + Bottom + + else if position.x > containerElement.element.x - documentViewport.x + elementViewport.width + offset.right then + Right + + else if position.y < containerElement.element.y - documentViewport.y - offset.top then + Top + + else if position.x < containerElement.element.x - documentViewport.x - offset.left then + Left + + else + None + + + +-- GHOST COORDINATES + + +baseCoordinates : Coordinates -> Coordinates -> Coordinates +baseCoordinates startPosition currentPosition = + Coordinates + (currentPosition.x - startPosition.x) + (currentPosition.y - startPosition.y) + + +coordinates : Coordinates -> Coordinates -> ScrollMeta -> Coordinates +coordinates startPosition currentPosition { scrollOptions, containerElement, containerViewport, documentViewport } = + if scrollOptions.hasWall then + walledCoordinates startPosition currentPosition scrollOptions.offset containerElement containerViewport documentViewport + + else + baseCoordinates startPosition currentPosition + + +walledCoordinates : Coordinates -> Coordinates -> Offset -> Browser.Dom.Element -> Browser.Dom.Viewport -> Browser.Dom.Viewport -> Coordinates +walledCoordinates startPosition currentPosition offset containerElement containerViewport documentViewport = + case direction currentPosition offset containerElement containerViewport.viewport documentViewport.viewport of + Bottom -> + Coordinates + (currentPosition.x - startPosition.x - containerElement.viewport.x) + (containerElement.element.y + containerElement.element.height - startPosition.y - containerElement.viewport.y + offset.bottom) + + Right -> + Coordinates + (containerElement.element.x + containerElement.element.width - startPosition.x - containerElement.viewport.x + offset.right) + (currentPosition.y - startPosition.y) + + Top -> + Coordinates + (currentPosition.x - startPosition.x - containerElement.viewport.x) + (containerElement.element.y - startPosition.y - containerElement.viewport.y - offset.top) + + Left -> + Coordinates + (containerElement.element.x - startPosition.x - containerElement.viewport.x - offset.left) + (currentPosition.y - startPosition.y) + + BottomLeft -> + Coordinates + (containerElement.element.x - startPosition.x - containerElement.viewport.x - offset.left) + (containerElement.element.y + containerElement.element.height - startPosition.y - containerElement.viewport.y + offset.bottom) + + BottomRight -> + Coordinates + (containerElement.element.x + containerElement.element.width - startPosition.x - containerElement.viewport.x + offset.right) + (containerElement.element.y + containerElement.element.height - startPosition.y - containerElement.viewport.y + offset.bottom) + + TopRight -> + Coordinates + (containerElement.element.x + containerElement.element.width - startPosition.x - containerElement.viewport.x + offset.right) + (containerElement.element.y - startPosition.y - containerElement.viewport.y - offset.top) + + TopLeft -> + Coordinates + (containerElement.element.x - startPosition.x - containerElement.viewport.x - offset.left) + (containerElement.element.y - startPosition.y - containerElement.viewport.y - offset.top) + + None -> + baseCoordinates startPosition currentPosition diff --git a/src/Internal/Types.elm b/src/Internal/Types.elm new file mode 100644 index 0000000..b2b8027 --- /dev/null +++ b/src/Internal/Types.elm @@ -0,0 +1,45 @@ +module Internal.Types exposing (..) + +import DnDList exposing (..) + + +type alias DragIndex = + Int + + +type alias DropIndex = + Int + + +type alias DragElementId = + String + + +type alias DropElementId = + String + + +type alias ContainerElementId = + String + + +type alias Coordinates = + { x : Float + , y : Float + } + + +type alias Offset = + { top : Float + , right : Float + , bottom : Float + , left : Float + } + + +type alias ScrollOptions = + { containerElementId : ContainerElementId + , orientation : Orientation + , offset : Offset + , hasWall : Bool + } diff --git a/tests/Test/Internal/Common/Operations.elm b/tests/Test/Internal/Operations.elm similarity index 97% rename from tests/Test/Internal/Common/Operations.elm rename to tests/Test/Internal/Operations.elm index e7c72a5..080d2ba 100755 --- a/tests/Test/Internal/Common/Operations.elm +++ b/tests/Test/Internal/Operations.elm @@ -1,8 +1,8 @@ -module Test.Internal.Common.Operations exposing (suite) +module Test.Internal.Operations exposing (suite) import Expect import Fuzzer -import Internal.Common.Operations exposing (..) +import Internal.Operations exposing (..) import Test