profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/drnic/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Dr Nic Williams drnic Stark & Wayne LLC @starkandwayne Brisbane, Australia http://starkandwayne.com CEO of Stark & Wayne LLC; CEO of Mocra Pty Ltd

defunkt/github-gem 1113

`github` command line helper for simplifying your GitHub experience.

bmabey/cucumber-tmbundle 282

TextMate bundle for Cucumber - This fork is no longer maintained, please see the README.

afcapel/stimulus-autocomplete 225

Stimulus autocomplete component

drnic/appscrolls 221

The App Scrolls is a magical tool to generate new Rails apps and modify existing Rails applications (coming) to include your favourite, powerful magic.

dchelimsky/rspec-tmbundle 201

Textmate bundle for RSpec.

bodymindarts/delmo 22

DelMo is a tool to test systems running within multiple docker containers

bjeanes/tmbundle-collection 14

Collection of TextMate bundles hosted on GitHub to get

calavera/ey_cli 11

Alternative CLI for Engine Yard Cloud

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha 50906ab6fd1074b6128b5701456754c0316a88c5

installer.js injected by Shopify App

view details

push time in 2 hours

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha fd91b4b83e996d774b0c23c4c221a806f3a923c8

Versioned og:image url

view details

push time in 2 hours

pull request commentafcapel/stimulus-autocomplete

Update to @hotwired/stimulus 3.0.0

Awesome. I'm on vacation + haven't played with SJS3.0 (nor this PR) yet. Will review + cut major release of our plugin soon.

jasonlor

comment created time in 5 hours

startedrails/kredis

started time in 12 days

PR opened rails/kredis

Add native nokogiri to Gemfile.lock

I needed this in Gemfile.lock to get native nokogiri gem please.

+3 -0

0 comment

1 changed file

pr created time in 12 days

create barnchdrnic/kredis

branch : apple-silicon

created branch time in 12 days

fork drnic/kredis

Higher-level data structures built on Redis

fork in 12 days

startedtestimio/root-cause

started time in 18 days

pull request commentafcapel/stimulus-autocomplete

Enabling Transitions: always dispatch the toggle event

Thanks for reminding me. Merged.

weaverryan

comment created time in 19 days

push eventafcapel/stimulus-autocomplete

Ryan Weaver

commit sha e636d0db49488eea18800cb5bfbf86b6530bf017

Always call open or close to hide/show the element

view details

Ryan Weaver

commit sha cb6949d13761b3c89287fa05714ca9a471baaf09

Adding an isHidden property to track the "state" independent of this.element.hidden

view details

Ryan Weaver

commit sha e05592f8308503cf7403e6573dcaf9b539a0191f

Adding a new option to skip setting the hidden property

view details

Ryan Weaver

commit sha 8fdc6c00f63e12bd4ca2130a698d827420c7a659

Changing undefined input and results on event to the targets

view details

Dr Nic Williams

commit sha 2331c9ea3bbd0f7e7fad4352333e5152d42f7502

Merge pull request #61 from weaverryan/toggle-event-always Enabling Transitions: always dispatch the toggle event

view details

push time in 19 days

PR merged afcapel/stimulus-autocomplete

Enabling Transitions: always dispatch the toggle event

Hi!

This closes #59.

I've created 3 clean commits to show the incremental progress - I have tried to change as little as possible:

  1. The controller already has open() and close() methods, but they were not consistently called. The first commit always calls these methods when opening or closing the element. This means that the toggle event is now dispatched in open/close situations when it wasn't before, but I think this is a bug fix :). The docs state that the toggle event "fires when the results element is shown or hidden". I also added a new action key to the event set to open or close so that a listener can determine what's happening.

  2. Added a this.isHidden property to the controller to track the "is hidden" state, instead of relying on this.resultsTarget.hidden.

  3. Added a new skipHiddenProperty value that can be set if you want to avoid this.resultsTarget.hidden from being set (because you want to handle hiding/showing yourself).

The end result of this is that a user can now leverage use-transition to add, for example, a fade-in/out for this auto-complete. I'll include that example code below in case anyone is interested :).

Thanks!


Transitions with stimulus-use

A) The HTML:

<div
    data-controller="autocomplete autocomplete-transition"
    data-autocomplete-url-value="/some/url"
    data-autocomplete-skip-hidden-property-value="1"
    data-action="toggle->autocomplete-transition#toggle"
>
    <input data-autocomplete-target="input">

    <div
        data-autocomplete-target="results"
        data-autocomplete-transition-target="results">
    </div>
</div>

B) Custom autocomplete-transition controller:

import { Controller } from 'stimulus';
import { useTransition } from 'stimulus-use';

export default class extends Controller {
    static targets = ['results'];

    connect() {
        useTransition(this, {
            element: this.resultsTarget,
            enterActive: 'fade-enter-active',
            enterFrom: 'fade-enter-from',
            enterTo: 'fade-enter-to',
            leaveActive: 'fade-leave-active',
            leaveFrom: 'fade-leave-from',
            leaveTo: 'fade-leave-to',
            hiddenClass: 'd-none',
        });
    }

    toggle(event) {
        if (event.detail.action === 'open') {
            this.enter();
        } else {
            this.leave();
        }
    }
}

C) Some fade out / fade in CSS

.fade-enter-active, .fade-leave-active {
    transition: opacity 2000ms;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
}
.fade-enter-to, .fade-leave-from {
    opacity: 1;
}
+33 -15

6 comments

2 changed files

weaverryan

pr closed time in 19 days

issue closedafcapel/stimulus-autocomplete

[RFC] Support for useTransition with consistent "toggle" event (or new open/close events)

Hi!

FYI - I would be fully open to submitting a PR for this feature :).

I'd like to integrate the useTransition() mixin from stimulus-use - https://stimulus-use.github.io/stimulus-use/#/use-transition - to get a nice fade in/fade out effect. To do that, I need an event from stimulus-autocomplete that allows me to know when the results target is being shown/hidden.

stimulus-autocomplete does have a toggle event, but it's only used in the open() and close() methods: no toggle event is triggered as a result of the AJAX call or if the results close due to a "blur" in the input.

I believe we can support this fairly easily:

  1. Dispatch a new open event in ALL cases when the results target changes from "closed" to "opened"
  2. Similarly, dispatch a close event in ALL cases when the results target changes from "opened" to "closed"
  3. A new option/value - useHiddenAttribute - that defaults to true. If this is set to false, then the library will not add/remove the this.element.hidden. This will allow users to apply their own logic.

With this setup (and I would verify this) I believe you could use the built-in controller from stimulus-autocomplete and the built-in transition controller from stimulus-use entirely in HTML to add fading out to this library, without custom JavaScript.

Any issues with this proposal?

Cheers and thanks for the wonderful library!

closed time in 19 days

weaverryan

issue openedShopify/browser_sniffer

Reduce to one license please

Currently this repo is dual licensed GPL2 + MIT, which means the rules of both apply.

Could we change the license to just MIT please?

created time in a month

issue openedParamagicDev/mrujs

Compatibility methods missing

I'm using some @rails/ujs methods that might be missing or need docs for compatibility to switch over to mrujs:

  • Rails.delegate
  • Rails.fire
  • Rails.linkDisableSelector
  • Rails.buttonDisableSelector
  • Rails.formSubmitSelector
  • Rails.confirm - I see this in my code base but I don't think its used

My code base also uses Rails.ajax but AFAIK I need to port that to fetch right?

created time in a month

push eventdrnic/shopify-hotwire-sample

Dr Nic Williams

commit sha cdacbe26337903f0d04b613dc4f019705e60d7df

Tiny ruby improvement

view details

push time in a month

CommitCommentEvent

startedkirillplatonov/shopify_app

started time in 2 months

push eventmocra/shopify-dawn-theme

push time in 2 months

create barnchmocra/shopify-dawn-theme

branch : use-scripttags

created branch time in 2 months

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha 439f3b1912110afb07609d25d94b56cd9fa7a4ec

JavaScript injected by Shopify scripttags

view details

push time in 2 months

created tagmocra/shopify-dawn-theme

tagupstream

created time in 2 months

created tagmocra/shopify-dawn-theme

tagv1.1.0

created time in 2 months

created tagmocra/shopify-dawn-theme

tagv1.0.0

created time in 2 months

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha 3e2bb1e088a1aa0c2042a497d50e1291987517eb

More tailwind

view details

push time in 2 months

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha 1f5880feeb7ff33ed222b9442dd0d8020b8c0a7a

Dynamically load tailwind if livelinks enabled

view details

push time in 2 months

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha cbf8f84cb5af81376a05f2b95d48f8b67085d8a8

Escape shop name

view details

push time in 2 months

push eventmocra/shopify-dawn-theme

Dr Nic Williams

commit sha eb6b56e363a01f4b38e607190a305c2b3c886b53

Blank + Common title designer

view details

push time in 2 months

issue closedkirillplatonov/shopify-hotwire-sample

app-bridge-utils v2

I think new apps need to implement app-bridge-utils v2 and its host param (in lieu of shop_origin I think)

closed time in 2 months

drnic

issue commentkirillplatonov/shopify-hotwire-sample

app-bridge-utils v2

Confirmed working for me. Awesome work.

drnic

comment created time in 2 months