Skip to content

Update MiniColors to 2.3.6 - #11

Merged
erseco merged 1 commit into
mainfrom
fix/update-minicolors
Sep 19, 2026
Merged

erseco merged 1 commit into
mainfrom
fix/update-minicolors

Conversation

@erseco

@erseco erseco commented Sep 19, 2026

Copy link
Copy Markdown

Why

The colour pickers ran jQuery miniColors 1.5.0, from 2011. The maintained release is @claviska/jquery-minicolors 2.3.6 — the scoped package; the unscoped jquery-minicolors on npm is stale and not the author's.

API migration

2.x renames the plugin and reworks its callbacks. The call sites moved with it rather than hiding behind a shim named .miniColors():

1.5.0 2.3.6
.miniColors({ move: fn }) .minicolors({ change: fn })
.miniColors({ hide: fn(hex) }) .minicolors({ hide: fn() }) — no argument, and this is the element rather than a jQuery object, so the value is read back from the input
.miniColors("value", c) .minicolors("value", c)
.miniColors("disabled", b) .prop("disabled", b) — 2.x has no such method and checks the input's own property

Both halves come from the same release: the five sprite images of 1.5 are replaced by the single sheet 2.3.6 ships. The stylesheet keeps its historical jquery.miniColors.css spelling — it differs from upstream's name only in case, which is the same file on a case-insensitive filesystem, and eXeLearning links this path from its own editor page.

Two adjustments the panel needed

1.5 appended its picker to document.body. 2.x renders the panel inside the input's own wrapper, which puts it inside the float panel's stacking context — and that changes what can cover it:

  • Left-aligned, the panel spilled past the inspector's right edge, where the canvas painted over the colour grid. It now opens right-aligned (position: 'bottom right'), keeping it within the panel.
  • Every float panel sits at z-index: 1000, and the navigator comes after the inspector in the document, so it painted straight over the grid. The panel holding an open picker is now lifted above its siblings.

Both were found by measuring elementFromPoint over the grid — the widget looked fine and simply ignored clicks.

Provenance

The upstream JavaScript carries no version string, so a banner records it.

@claviska/jquery-minicolors@2.3.6   MIT
upstream sha256  85037c6c1928b9a7163b63f5b58aa72a3fbc5fee9cc9e10bcd1f804c6eb2e853

Validation

npm ci && npm test && npm run build 13 tests pass
Two clean builds byte-identical (ff9f393782d4…)
eXeLearning Playwright suite 25 passed

The browser coverage picks a colour from the real gradient through the initialised widget, then checks the rendered node colour changed and that the value survives deselecting and reselecting the node — a model round-trip, not just the input. Branch colour likewise. Those tests passed against 1.5.0 before this change, which is what makes them a description of existing behaviour.

The Inspector is otherwise untouched; no redesign.

The colour pickers ran jQuery miniColors 1.5.0, from 2011. The maintained
release is @claviska/jquery-minicolors 2.3.6 -- the scoped package, since the
unscoped one is stale and not the author's.

2.x renames the plugin and reworks its callbacks, so the call sites moved
with it rather than hiding behind a shim:

  .miniColors({move: fn})   ->  .minicolors({change: fn})
  .miniColors({hide: fn})   ->  .minicolors({hide: fn}), which now takes no
                                argument and whose `this` is the element, so
                                the value is read back from the input
  .miniColors("value", c)   ->  .minicolors("value", c)
  .miniColors("disabled",b) ->  .prop("disabled", b); 2.x has no such method
                                and checks the input's own property instead

Both halves come from the same release. The five sprite images of 1.5 are
replaced by the single sheet 2.3.6 ships, and the stylesheet keeps its
historical jquery.miniColors.css spelling: it differs from upstream's name
only in case, which is the same file on a case-insensitive filesystem, and
eXeLearning links this path from its own editor page.

Two adjustments were needed for the panel to be usable. 1.5 appended its
picker to the body; 2.x renders it inside the input's wrapper, which puts it
inside the float panel's stacking context. Left-aligned it spilled past the
inspector's edge where the canvas painted over it, so it opens right-aligned;
and every float panel sits at z-index 1000, so the navigator -- later in the
document -- covered the colour grid until the panel holding an open picker is
lifted above its siblings.

The upstream JavaScript carries no version string, so a banner records it.
Vendored from @claviska/jquery-minicolors@2.3.6, MIT, upstream sha256
85037c6c1928b9a7163b63f5b58aa72a3fbc5fee9cc9e10bcd1f804c6eb2e853.

Two clean builds are byte-identical. eXeLearning's browser suite passes all
25 tests, including picking a colour from the real gradient and checking the
node re-renders and the value survives deselect and reselect.
@erseco
erseco merged commit 27b6b55 into main Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant